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):
          res = {
              "nutt": len(results),
              "error": results[:, 0].mean(),
              "std": results[:, 0].std(),
              "dur_ref": int(results[:, 1].sum()),
              "dur_syn": int(results[:, 2].sum()),
          }
          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_f0.py
imports: import numpy
  import os.path
  import torchaudio
  import tqdm
  from tabulate import tabulate
  from examples.speech_synthesis.utils import gross_pitch_error, voicing_decision_error, f0_frame_error
  from examples.speech_synthesis.evaluation.eval_sp import load_eval_spec
label_desc: Use image node_id 10 for calling a global function with example usage: print_results(results, show_bin) without return types