def fmatch_best(needle, haystack, min_ratio=0.6):
 try:
  return sorted(fmatch_iter(needle, haystack, min_ratio), reverse=True)[0][1]
 except IndexError:
  pass

def fmatch_best ( needle , haystack , min_ratio = 0.6 ) : try : return sorted ( fmatch_iter ( needle , haystack , min_ratio ) , reverse = True ) [ 0 ] [ 1 ] except IndexError : pass
fuzzy match - find best match .