import glob


def get_files_dict(path, id_list):
    """
    Get dict of each subject id and its associated filepath. Intendedn for use
    during data preparation, before analysis.
    """

    id_file_dict = {}
    for id_ in id_list:
        for file in glob.iglob(path.format(id_), recursive=True):
            id_file_dict[id_] = file
    return id_file_dict