(variables)
return var_string
A function that formats the descriptive part of the input/output summary for
    either features, targets or metas of the input dataset.

    :param variables: Features, targets or metas of the input dataset
    :return: A formatted string
A function that formats the descriptive part of the input/output summary for
    either features, targets or metas of the input dataset.
A function that formats the descriptive part of the input / output summary for either features targets or metas of the input dataset .
def format_variables_string(variables):
    """
    A function that formats the descriptive part of the input/output summary for
    either features, targets or metas of the input dataset.

    :param variables: Features, targets or metas of the input dataset
    :return: A formatted string
    """
    if not variables:
        return '—'

    agg = []
    for var_type_name, var_type in [('categorical', DiscreteVariable),
                                    ('numeric', ContinuousVariable),
                                    ('time', TimeVariable),
                                    ('string', StringVariable)]:
        # Disable pylint here because a `TimeVariable` is also a
        # `ContinuousVariable`, and should be labelled as such. That is why
        # it is necessary to check the type this way instead of using
        # `isinstance`, which would fail in the above case
        var_type_list = [v for v in variables if type(v) is var_type]  # pylint: disable=unidiomatic-typecheck
        if var_type_list:
            agg.append((var_type_name, len(var_type_list)))

    attrs, counts = list(zip(*agg))
    if len(attrs) > 1:
        var_string = [f'{i} {j}' for i, j in zip(counts, attrs)]
        var_string = f'{sum(counts)} ({", ".join(var_string)})'
    elif counts[0] == 1:
        var_string = attrs[0]
    else:
        var_string = f'{counts[0]} {attrs[0]}'
    return var_string
def format_variables_string ( variables ) : if not variables : return '—' agg = [ ] for var_type_name , var_type in [ ( 'categorical' , DiscreteVariable ) , ( 'numeric' , ContinuousVariable ) , ( 'time' , TimeVariable ) , ( 'string' , StringVariable ) ] : # Disable pylint here because a `TimeVariable` is also a # `ContinuousVariable`, and should be labelled as such. That is why # it is necessary to check the type this way instead of using # `isinstance`, which would fail in the above case var_type_list = [ v for v in variables if type ( v ) is var_type ] # pylint: disable=unidiomatic-typecheck if var_type_list : agg . append ( ( var_type_name , len ( var_type_list ) ) ) attrs , counts = list ( zip ( * agg ) ) if len ( attrs ) > 1 : var_string = [ f'{i} {j}' for i , j in zip ( counts , attrs ) ] var_string = f'{sum(counts)} ({", ".join(var_string)})' elif counts [ 0 ] == 1 : var_string = attrs [ 0 ] else : var_string = f'{counts[0]} {attrs[0]}' return var_string