def _sort_candidates(candidates):
 return sorted(candidates, key=(lambda match: match.distance))

def _sort_candidates ( candidates ) : return sorted ( candidates , key = ( lambda match : match . distance ) )
sort candidates by distance .