code: def process_file(
      inputname: str,
      out: TextIO,
      out_raw: TextIO,
      reference_vcb: Dict[Tuple[str, str], Dict[str, int]],
      sampling_vcb: Dict[str, int],
  ) -> None:
      words = []
      reference_words = []  # size may be different
      semiotic_info = []
      raw_lines = []
      sent_ok = True if args.sampling_count == -1 else False
      with open(inputname, "r", encoding="utf-8") as f:
          for line in f:
              if line.startswith("<eos>"):
                  if len(words) > 0 and sent_ok:
                      out.write(
                          " ".join(words)
                          + "\t"
                          + " ".join(reference_words)
                          + "\t"
                          + ";".join(semiotic_info)
                          + "\n"
                      )
                      out_raw.write("\n".join(raw_lines) + "\n" + line)
                  words = []
                  reference_words = []
                  semiotic_info = []
                  raw_lines = []
                  sent_ok = True if args.sampling_count == -1 else False
              else:
                  raw_lines.append(line.strip())
                  cls, written, spoken = line.strip().split("\t")
                  spoken = spoken_preprocessing(spoken)
                  written = written.casefold()
                  references = set()
                  if spoken == "sil":
                      continue
                  if spoken == "<self>":
                      words.append(written)
                      reference_words.append(written)
                      # if reference is <self>, but the word has itn conversions in our dictionary, add them
                      for cls in [
                          "CARDINAL",
                          "ORDINAL",
                          "DATE",
                      ]:  # date, ex sixties -> 60s
                          k = (cls, written)
                          if k in reference_vcb:
                              for tr_variant in reference_vcb[k]:
                                  references.add(tr_variant)
                              semiotic_info.append(
                                  cls
                                  + " "
                                  + str(len(words) - 1)
                                  + " "
                                  + str(len(words))
                                  + " | "
                                  + " | ".join(references)
                              )
                              break
                      continue
  
                  spoken_words = spoken.split()
                  words.extend(spoken_words)
  
                  k = (cls, spoken)
                  if k in reference_vcb:
                      for tr_variant in reference_vcb[k]:
                          references.add(tr_variant)
                  references.add(spoken)
                  references.add(written)
                  for tr_variant in list(references):
                      # 6,51 km² => 6,51 km 2
                      (tr_variant2, n2) = re.subn(
                          r"²", " 2", tr_variant
                      )
                      (tr_variant3, n3) = re.subn(
                          r"³", " 3", tr_variant
                      )
                      if n2 > 0:
                          references.add(tr_variant2)
                      if n3 > 0:
                          references.add(tr_variant3)
  
                  semiotic_info.append(
                      cls
                      + " "
                      + str(len(words) - len(spoken_words))
                      + " "
                      + str(len(words))
                      + " | "
                      + " | ".join(list(references))
                  )
                  reference_words.append(written.casefold())
  
                  if cls not in sampling_vcb:
                      sampling_vcb[cls] = 0
                  if sampling_vcb[cls] < args.sampling_count:
                      sent_ok = True
                      sampling_vcb[cls] += 1
  
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 1 for calling a global function with example usage: process_file(inputname, out, out_raw, reference_vcb, sampling_vcb) without return types