# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Transforms.RandomNumberGenerator
"""

import numbers

from ..utils.entrypoints import EntryPoint
from ..utils.utils import try_set, unlist


def transforms_randomnumbergenerator(
        column,
        data,
        output_data=None,
        model=None,
        use_counter=False,
        seed=42,
        **params):
    """
    **Description**
        Adds a column with a generated number sequence.

    :param column: New column definition(s) (optional form:
        name:seed) (inputs).
    :param data: Input dataset (inputs).
    :param use_counter: Use an auto-incremented integer starting at
        zero instead of a random number (inputs).
    :param seed: The random seed (inputs).
    :param output_data: Transformed dataset (outputs).
    :param model: Transform model (outputs).
    """

    entrypoint_name = 'Transforms.RandomNumberGenerator'
    inputs = {}
    outputs = {}

    if column is not None:
        inputs['Column'] = try_set(
            obj=column,
            none_acceptable=False,
            is_of_type=list,
            is_column=True)
    if data is not None:
        inputs['Data'] = try_set(
            obj=data,
            none_acceptable=False,
            is_of_type=str)
    if use_counter is not None:
        inputs['UseCounter'] = try_set(
            obj=use_counter,
            none_acceptable=True,
            is_of_type=bool)
    if seed is not None:
        inputs['Seed'] = try_set(
            obj=seed,
            none_acceptable=True,
            is_of_type=numbers.Real)
    if output_data is not None:
        outputs['OutputData'] = try_set(
            obj=output_data,
            none_acceptable=False,
            is_of_type=str)
    if model is not None:
        outputs['Model'] = try_set(
            obj=model,
            none_acceptable=False,
            is_of_type=str)

    input_variables = {
        x for x in unlist(inputs.values())
        if isinstance(x, str) and x.startswith("$")}
    output_variables = {
        x for x in unlist(outputs.values())
        if isinstance(x, str) and x.startswith("$")}

    entrypoint = EntryPoint(
        name=entrypoint_name, inputs=inputs, outputs=outputs,
        input_variables=input_variables,
        output_variables=output_variables)
    return entrypoint
