def get_closest(word, possibilities, n=3, cutoff=0.6, fallback_to_first=True):
 possibilities = list(possibilities)
 try:
  return get_close_matches(word, possibilities, n, cutoff)[0]
 except IndexError:
  if fallback_to_first:
   return possibilities[0]

def get_closest ( word , possibilities , n = 3 , cutoff = 0.6 , fallback_to_first = True ) : possibilities = list ( possibilities ) try : return get_close_matches ( word , possibilities , n , cutoff ) [ 0 ] except IndexError : if fallback_to_first : return possibilities [ 0 ]
returns closest match or just first from possibilities .