def upconvert_to_list(list_or_dict):
    """
    Packed CWL workflow inputs/outputs are structured as lists of dicts (e.g.
    [{'id': 'input_file', 'type': 'File'},...]). Unpacked workflows may have
    dicts (e.g. {'input_file': 'File'}. This function converts the dicts into
    lists of dicts or returns the list

    :param list_or_dict:
    :return:
    """
    if isinstance(list_or_dict, list):
        return list_or_dict
    elif isinstance(list_or_dict, dict):
        return [{'id': k, 'type': v} for k,v in list_or_dict.items()]
    else:
        raise ValueError('Only list or dict are supported, not {}', type(list_or_dict))