code: def get_utt_permutation(old_dic, num_spkrs=2):
      perm, keys = permutation_schemes(num_spkrs)
      new_dic = {}
  
      for id in old_dic.keys():
          # compute error rate for each utt
          in_dic = old_dic[id]
          score = convert_score(perm, in_dic)
          perm_score = []
          for ks in keys:
              tmp_score = [0, 0, 0, 0]
              for k in ks:
                  tmp_score = [
                      tmp_score[i] + score[k][i] for i in range(4)
                  ]
              perm_score.append(tmp_score)
  
          error_rate = [
              sum(s[1:4]) / float(sum(s[0:3])) for s in perm_score
          ]  # (s+d+i) / (c+s+d)
  
          min_idx, min_v = min(
              enumerate(error_rate), key=lambda x: x[1]
          )
          dic = {}
          for k in keys[min_idx]:
              dic[k] = in_dic[k]
          dic["Scores"] = "(#C #S #D #I) " + " ".join(
              map(str, perm_score[min_idx])
          )
          new_dic[id] = dic
  
      return new_dic
  
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 4 for calling a global function with example usage: get_utt_permutation(old_dic, num_spkrs) and returns: new_dic