code: def scoring(ref, hyp, out):
      ref_file = codecs.open(ref, "r", encoding="utf-8")
      hyp_file = codecs.open(hyp, "r", encoding="utf-8")
  
      utt_num = 0
      correct = 0
  
      while True:
          ref_utt = ref_file.readline()
          hyp_utt = hyp_file.readline()
  
          if not ref_utt or not hyp_utt:
              break
  
          [rec_id, lid, utt_id] = ref_utt.strip().split()
          [hrec_id, hlid, hutt_id] = hyp_utt.strip().split()
  
          assert (
              rec_id == hrec_id and utt_id == hutt_id
          ) and "Mismatch in trn id"
  
          if lid == hlid:
              correct += 1
          utt_num += 1
      out.write(
          "Language Identification Scoring: Accuracy {:.4f} ({}/{})".format(
              (correct / float(utt_num)), correct, utt_num
          )
      )
  
imports: import argparse
  import codecs
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: scoring(ref, hyp, out) without return types