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

import numbers

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


def transforms_approximatebootstrapsampler(
        data,
        output_data=None,
        model=None,
        complement=False,
        seed=None,
        shuffle_input=True,
        pool_size=1000,
        **params):
    """
    **Description**
        Approximate bootstrap sampling.

    :param data: Input dataset (inputs).
    :param complement: Whether this is the out-of-bag sample, that
        is, all those rows that are not selected by the transform.
        (inputs).
    :param seed: The random seed. If unspecified random state will be
        instead derived from the environment. (inputs).
    :param shuffle_input: Whether we should attempt to shuffle the
        source data. By default on, but can be turned off for
        efficiency. (inputs).
    :param pool_size: When shuffling the output, the number of output
        rows to keep in that pool. Note that shuffling of output is
        completely distinct from shuffling of input. (inputs).
    :param output_data: Transformed dataset (outputs).
    :param model: Transform model (outputs).
    """

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

    if data is not None:
        inputs['Data'] = try_set(
            obj=data,
            none_acceptable=False,
            is_of_type=str)
    if complement is not None:
        inputs['Complement'] = try_set(
            obj=complement,
            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 shuffle_input is not None:
        inputs['ShuffleInput'] = try_set(
            obj=shuffle_input,
            none_acceptable=True,
            is_of_type=bool)
    if pool_size is not None:
        inputs['PoolSize'] = try_set(
            obj=pool_size,
            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
