code: def main():
      parser = get_parser()
      args = parser.parse_args()
  
      if len(args.results) != args.num_spkrs**2:
          parser.print_help()
          sys.exit(1)
  
      # Read results from files
      results = {}
      for r in range(1, args.num_spkrs + 1):
          for h in range(1, args.num_spkrs + 1):
              idx = (r - 1) * args.num_spkrs + h - 1
              key = "r{}h{}".format(r, h)
  
              result = get_results(args.results[idx], key)
              results[key] = result
  
      # Merge the results of every permutation
      results = merge_results(results)
  
      # Get the final results with best permutation
      new_results = get_utt_permutation(results, args.num_spkrs)
  
      # Get WER/CER
      pat = re.compile(r"\d+")
      score = np.zeros((len(new_results.keys()), 4))
      for idx, key in enumerate(new_results.keys()):
          # [c, s, d, i]
          tmp_score = list(
              map(int, pat.findall(new_results[key]["Scores"]))
          )
          score[idx] = tmp_score
      return score, new_results
  
file_path: espnet/utils/eval_perm_free_error.py
imports: import argparse
  import codecs
  import json
  import logging
  import re
  import sys
  import numpy
label_desc: Use image node_id 8 for calling a global function with example usage: main() and returns: score,  new_results