code: def main() -> None:
      if not os.path.exists(args.data_dir):
          raise ValueError(f"Data dir {args.data_dir} does not exist")
      reference_vcb = {}
      with open(args.reference_vocab, "r", encoding="utf-8") as f:
          for line in f:
              sem, spoken, written, freq = line.strip().split("\t")
              k = (sem, spoken)
              if k not in reference_vcb:
                  reference_vcb[k] = {}
              reference_vcb[k][written] = int(freq)
      sampling_vcb = Counter()
      out = open(args.output_file, "w", encoding="utf-8")
      out_raw = open(args.output_file + ".raw", "w", encoding="utf-8")
      input_paths = sorted(
          [
              os.path.join(args.data_dir, f)
              for f in os.listdir(args.data_dir)
          ]
      )
      for inputname in input_paths:
          process_file(
              inputname, out, out_raw, reference_vcb, sampling_vcb
          )
      out.close()
      out_raw.close()
  
imports: import os
  import re
  from argparse import ArgumentParser
  from collections import Counter
  from typing import Dict, TextIO, Tuple
  from nemo.collections.nlp.data.text_normalization_as_tagging.utils import spoken_preprocessing
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types