def did_you_mean(message: str, user_input: str, choices: Sequence[str]) -> str:
if not choices:<EOL><INDENT>return message<EOL><DEDENT>else:<EOL><INDENT>result = {<EOL>difflib.SequenceMatcher(a=user_input, b=choice).ratio(): choice<EOL>for choice in choices<EOL>}<EOL>message += "<STR_LIT>" % result[max(result)]<EOL>return message<EOL><DEDENT>
Given a list of choices and an invalid user input, display the closest
    items in the list that match the input.