def select_choice_from_multiple_matches(filename, match_set):
    """
    Function to ask user to choice which issue metadata to write,
    when there are multiple choices
    """
    print(f'\n{filename.name} - Multiple results found:')
    match_set = sorted(match_set, key=lambda m: m['cover_date'])
    for counter, match in enumerate(match_set, start=1):
        print(f"{counter}. {match['__str__']} ({match['cover_date']})")
    while True:
        i = input("Choose a match #, or 's' to skip: ")
        if i.isdigit() and int(i) in range(1, len(match_set) + 1) or i == 's':
            break
    if i != 's':
        i = int(i) - 1
        issue_id = match_set[i]['id']
    else:
        issue_id = None
    return issue_id
