def dictionarify_recpat_data(recpat_data):
    """
    Covert a list of flat dictionaries (single-record dicts) into a dictionary.
    If the given data structure is already a dictionary, it is left unchanged.
    """

    return {track_id[0]: patterns[0] for track_id, patterns in \
            [zip(*item.items()) for item in recpat_data]} \
                if not isinstance(recpat_data, dict) else recpat_data