# - Generated by tools/entrypoint_compiler.py: do not edit by hand
"""
Models.EnsembleSummary
"""


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


def models_ensemblesummary(
        predictor_model,
        summaries,
        stats,
        **params):
    """
    **Description**
        Summarize a pipeline ensemble predictor.

    :param predictor_model: The predictor to summarize (inputs).
    :param summaries: The summaries of the individual predictors
        (outputs).
    :param stats: The model statistics of the individual predictors
        (outputs).
    """

    entrypoint_name = 'Models.EnsembleSummary'
    inputs = {}
    outputs = {}

    if predictor_model is not None:
        inputs['PredictorModel'] = try_set(
            obj=predictor_model,
            none_acceptable=False,
            is_of_type=str)
    if summaries is not None:
        outputs['Summaries'] = try_set(
            obj=summaries,
            none_acceptable=False,
            is_of_type=list)
    if stats is not None:
        outputs['Stats'] = try_set(
            obj=stats,
            none_acceptable=False,
            is_of_type=list)

    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
