code: def print_report(samples, losses, wer, cer, dataset_name):
      """Print a report summary and samples of best, median and worst results"""
  
      # Print summary
      mean_loss = np.mean(losses)
      print(
          "Test on %s - WER: %f, CER: %f, loss: %f"
          % (dataset_name, wer, cer, mean_loss)
      )
      print("-" * 80)
  
      best_samples = samples[: FLAGS.report_count]
      worst_samples = samples[-FLAGS.report_count :]
      median_index = int(len(samples) / 2)
      median_left = int(FLAGS.report_count / 2)
      median_right = FLAGS.report_count - median_left
      median_samples = samples[
          median_index - median_left : median_index + median_right
      ]
  
      def print_single_sample(sample):
          print(
              "WER: %f, CER: %f, loss: %f"
              % (sample.wer, sample.cer, sample.loss)
          )
          print(" - wav: file://%s" % sample.wav_filename)
          print(' - src: "%s"' % sample.src)
          print(' - res: "%s"' % sample.res)
          print("-" * 80)
  
      print("Best WER:", "\n" + "-" * 80)
      for s in best_samples:
          print_single_sample(s)
  
      print("Median WER:", "\n" + "-" * 80)
      for s in median_samples:
          print_single_sample(s)
  
      print("Worst WER:", "\n" + "-" * 80)
      for s in worst_samples:
          print_single_sample(s)
  
file_path: DeepSpeech/training/deepspeech_training/util/evaluate_tools.py
imports: from __future__ import absolute_import, division, print_function
  import json
  from multiprocessing.dummy import Pool
  import numpy
  from attrdict import AttrDict
  from .flags import FLAGS
  from .text import levenshtein
  from .io import open_remote
label_desc: Use image node_id 5 for calling a global function with example usage: print_report(samples, losses, wer, cer, dataset_name) without return types