#NEWLINE# def formatSuggestion( name , possibleSuggestions = None , message = 'Did you mean %s?\n' , threshold = 2 , includeIdenticalName = False ) : #NEWLINE# #INDENT# "Returns the string message to display with the closest matching\n  suggestion. Returns a blank string if there are no matches within the\n  threshold.\n\n  Args:\n      name (str) - The typo'd name the user supplied.\n      possibleSuggestions (sequence of str, optional) - A sequence of strings\n        for all possible suggestions that the name could match to. This\n        function will pull suggestions from this list.\n      message (str, optional) - The format of the suggestion message to print.\n        A %s conversion specifier will be replaced with the suggested name.\n        Default is 'Did you mean %s?\n'\n      threshold (int, optional) - A levenshtein edit distance above this\n        threshold will exclude a name from being suggested. Default is 2.\n      includeIdenticalName (bool, optional) - If True, a name identical to\n        the name arg will be included in the suggestions. Default is False." #NEWLINE# suggestedName = suggest ( name , possibleSuggestions , threshold , includeIdenticalName ) #NEWLINE# if ( message is not None ) : #NEWLINE# #INDENT# return ( message % suggestedName ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ''