code: def main(args):
      """Run the main normalizing function."""
      parser = get_parser()
      args = parser.parse_args(args)
  
      # logging info
      if args.verbose == 1:
          logging.basicConfig(
              level=logging.INFO,
              format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
          )
      elif args.verbose == 2:
          logging.basicConfig(
              level=logging.DEBUG,
              format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
          )
      else:
          logging.basicConfig(
              level=logging.WARN,
              format="%(asctime)s (%(module)s:%(lineno)d) %(levelname)s: %(message)s",
          )
          logging.warning("Skip DEBUG/INFO messages")
  
      # check input arguments
      if not os.path.exists(args.in_ref):
          logging.error("Filename '" + args.in_ref + "' is not exist")
          logging.error("Please check the '--in-ref' argument")
          sys.exit(1)
      else:
          logging.info("Loading reference text: " + args.in_ref)
      if not os.path.exists(args.in_hyp):
          logging.error("Filename '" + args.in_hyp + "' is not exist")
          logging.error("Please check the '--raw-trans' argument")
          sys.exit(1)
      else:
          logging.info("Loading hypothesis text: " + args.in_hyp)
  
      # read lines of ref & hyp files
      refs = open(args.in_ref, "r").readlines()
      hyps = open(args.in_hyp, "r").readlines()
  
      # comparing the number of files
      if len(refs) != len(hyps):
          logging.error(
              "# of sentences in refs(%s) and hyps(%s) are different."
              % (str(len(refs)), str(len(hyps)))
          )
          sys.exit(1)
  
      # create normalized ref & hyp files
      save_norm_ref = open(args.out_ref, mode="w")
      save_norm_hyp = open(args.out_hyp, mode="w")
  
      # run Levenshtein alignment processing
      for i, _ in enumerate(refs):
          # get utt-id
          ref_pos = refs[i].rindex("(")
          hyp_pos = hyps[i].rindex("(")
          ref_utt_id = refs[i][ref_pos + 1 :].strip()[:-1]
          hyp_utt_id = hyps[i][hyp_pos + 1 :].strip()[:-1]
  
          # check the number of line in two texts
          if ref_utt_id != hyp_utt_id:
              logging.error(
                  "The utt-id is not sorted. (ref[%s:%s], hyp[%s:%s])"
                  % (str(ref_utt_id), str(i), str(hyp_utt_id), str(i))
              )
              sys.exit(1)
  
          # do character-level tokenizing with space symbol ('_')
          ref = (
              " ".join(
                  space_sym
                  + refs[i][:ref_pos].strip().replace(" ", space_sym)
              )
              .replace(space_sym + " ", space_sym)
              .split()
          )
          hyp = (
              " ".join(
                  space_sym
                  + hyps[i][:hyp_pos].strip().replace(" ", space_sym)
              )
              .replace(space_sym + " ", space_sym)
              .split()
          )
  
          # get space-normalized texts with Levenshtein algorithm
          hyp_norm, ref_norm = get_norm_text(hyp, ref)
  
          # save space-normalized texts
          save_norm_hyp.write(
              str(" ".join(hyp_norm)).strip() + "(" + hyp_utt_id + ")\n"
          )
          save_norm_ref.write(
              str(" ".join(ref_norm)).strip() + "(" + ref_utt_id + ")\n"
          )
  
      # close files
      save_norm_ref.close()
      save_norm_hyp.close()
  
      logging.info("Succeeded creating normalized texts.")
  
file_path: espnet/egs/ksponspeech/asr1/local/get_space_normalized_hyps.py
imports: import logging
  import os
  import sys
  import configargparse
  from numpy import zeros
label_desc: Use image node_id 5 for calling a global function with example usage: main(args) without return types