human
Complete this python program:
def expand_meta_parameters(trans, tool, incoming):
assistant
#Here is the Python program you requested.

    """Take in a dictionary of raw incoming parameters and expand to a list
    of expanded incoming parameters (one set of parameters per tool
    execution).
    """
    to_remove = []
    for key in incoming.keys():
        if key.endswith('|__identifier__'):
            to_remove.append(key)
    for key in to_remove:
        incoming.pop(key)
    def classifier(input_key):
        value = incoming[input_key]
        if (isinstance(value, dict) and ('values' in value)):
            is_batch = value.get('batch', False)
            is_linked = value.get('linked', True)
            if (is_batch and is_linked):
                classification = permutations.input_classification.MATCHED
            elif is_batch:
                classification = permutations.input_classification.MULTIPLIED
            else:
                classification = permutations.input_classification.SINGLE
            if __collection_multirun_parameter(value):
                collection_value = value['values'][0]
                values = __expand_collection_parameter(trans, input_key, collection_value, collections_to_match, linked=is_linked)
            else:
                values = value['values']
        else:
            classification = permutations.input_classification.SINGLE
            values = value
        return (classification, values)
    from galaxy.dataset_collections import matching
    collections_to_match = matching.CollectionsToMatch()
    incoming_template = incoming.copy()
    expanded_incomings = permutations.expand_multi_inputs(incoming_template, classifier)
    if collections_to_match.has_collections():
        collection_info = trans.app.dataset_collections_service.match_collections(collections_to_match)
    else:
        collection_info = None
    return (expanded_incomings, collection_info)