def extractBests(query, choices, processor=default_processor, scorer=default_scorer, score_cutoff=0, limit=5):
 best_list = extractWithoutOrder(query, choices, processor, scorer, score_cutoff)
 return (heapq.nlargest(limit, best_list, key=(lambda i: i[1])) if (limit is not None) else sorted(best_list, key=(lambda i: i[1]), reverse=True))

def extractBests ( query , choices , processor = default_processor , scorer = default_scorer , score_cutoff = 0 , limit = 5 ) : best_list = extractWithoutOrder ( query , choices , processor , scorer , score_cutoff ) return ( heapq . nlargest ( limit , best_list , key = ( lambda i : i [ 1 ] ) ) if ( limit is not None ) else sorted ( best_list , key = ( lambda i : i [ 1 ] ) , reverse = True ) )
get a list of the best matches to a collection of choices .