def _parse_aggregation_feat(aggregating_in, features):
    """Parse aggregation information and format in a correct standard way.

    Parameters
    ----------
    aggregating_in: tuple
        the information for aggregating features
    features: pst.BaseFeatures
        the features we want to aggregate.

    Returns
    -------
    agg_f_ret: function
        the aggregation function for the retriever part.
    desc_in: pst.BaseDescriptorModel
        the descriptormodel to compute the aggregated features.
    pars_feat_in: dict
        the parameters of the featuresmanager to compute the aggregate
        features.
    pars_feats: dict
        the parameters in order to instantiate the new aggregated features.
    desc_out: pst.BaseDescriptorModel
        the descriptormodel to use in the new aggregated features.

    """
    assert(type(aggregating_in) == tuple)
    if len(aggregating_in) == 5:
        agg_f_ret, desc_in, pars_feat_in, pars_feats, desc_out = aggregating_in
    elif len(aggregating_in) == 4:
        agg_f_ret, desc_in, pars_feat_in, pars_feats = aggregating_in
        desc_out = features.descriptormodel

    elif len(aggregating_in) == 3 and type(aggregating_in[1]) == dict:
        agg_f_ret, pars_feat_in, pars_feats = aggregating_in
        desc_in = features.descriptormodel
        desc_out = features.descriptormodel
    elif len(aggregating_in) == 3 and type(aggregating_in[1]) != dict:
        agg_f_ret, desc_in, desc_out = aggregating_in
        pars_feat_in, pars_feats = {}, {}
    else:
        agg_f_ret = aggregating_in[0]
        pars_feat_in, pars_feats = {}, {}
        desc_in = features.descriptormodel
        desc_out = features.descriptormodel
    return agg_f_ret, desc_in, pars_feat_in, pars_feats, desc_out