code: def print_results(results, show_bin):
      results = np.array(list(filter(lambda x: x is not None, results)))
  
      np.set_printoptions(precision=3)
  
      def _print_result(results):
          dist, dur_ref, dur_syn, dur_ali, nins, ndel = results.sum(
              axis=0
          )
          res = {
              "nutt": len(results),
              "dist": dist,
              "dur_ref": int(dur_ref),
              "dur_syn": int(dur_syn),
              "dur_ali": int(dur_ali),
              "dist_per_ref_frm": dist / dur_ref,
              "dist_per_syn_frm": dist / dur_syn,
              "dist_per_ali_frm": dist / dur_ali,
              "ins": nins / dur_ref,
              "del": ndel / dur_ref,
          }
          print(tabulate([res.values()], res.keys(), floatfmt=".4f"))
  
      print(">>>> ALL")
      _print_result(results)
  
      if show_bin:
          edges = [0, 200, 400, 600, 800, 1000, 2000, 4000]
          for i in range(1, len(edges)):
              mask = np.logical_and(
                  results[:, 1] >= edges[i - 1],
                  results[:, 1] < edges[i],
              )
              if not mask.any():
                  continue
              bin_results = results[mask]
              print(f">>>> ({edges[i-1]}, {edges[i]})")
              _print_result(bin_results)
  
file_path: fairseq/examples/speech_synthesis/evaluation/eval_sp.py
imports: import csv
  import numpy
  import os.path
  import torch
  import tqdm
  from tabulate import tabulate
  import torchaudio
  from examples.speech_synthesis.utils import batch_mel_spectral_distortion
  from fairseq.tasks.text_to_speech import batch_mel_cepstral_distortion
label_desc: Use image node_id 5 for calling a global function with example usage: print_results(results, show_bin) without return types