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


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


def transforms_modelcombiner(
        output_model=None,
        models=None,
        **params):
    """
    **Description**
        Combines a sequence of TransformModels into a single model

    :param models: Input models (inputs).
    :param output_model: Combined model (outputs).
    """

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

    if models is not None:
        inputs['Models'] = try_set(
            obj=models,
            none_acceptable=True,
            is_of_type=list)
    if output_model is not None:
        outputs['OutputModel'] = try_set(
            obj=output_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
