Return the command with the name most similar to what the user typed.  This 
    is used to suggest a correct command when the user types an illegal 
    command.

def did_you_mean(unknown_command, entry_points):
    """
    Return the command with the name most similar to what the user typed.  This 
    is used to suggest a correct command when the user types an illegal 
    command.
    """
    from difflib import SequenceMatcher
    similarity = lambda x: SequenceMatcher(None, x, unknown_command).ratio()
    did_you_mean = sorted(entry_points, key=similarity, reverse=True)
    return did_you_mean[0]