code: def find_best_matches(errors, matchers):
      
      for text_log_error in errors:
          matches = find_all_matches(text_log_error, matchers)  # TextLogErrorMatch instances, unsaved!
  
          best_match = first(matches, key=lambda m: (-m.score, -m.classified_failure_id))
          if not best_match:
              continue
  
          newrelic.agent.record_custom_event('highest_scored_matcher', {
              'matcher': best_match.matcher_name,
              'score': best_match.score,
              'text_log_error': best_match.text_log_error_id,
          })
  
          yield best_match
docs: Find the best match for each error
  
      We use the Good Enough™ ratio as a watershed level for match scores.