code: def main():
      parser = get_parser()
      args = parser.parse_args()
  
      rs = []
      if args.non_lang_syms is not None:
          with codecs.open(
              args.non_lang_syms, "r", encoding="utf-8"
          ) as f:
              nls = [x.rstrip() for x in f.readlines()]
              rs = [re.compile(re.escape(x)) for x in nls]
  
      if args.text:
          f = codecs.open(args.text, encoding="utf-8")
      else:
          f = codecs.getreader("utf-8")(
              sys.stdin if is_python2 else sys.stdin.buffer
          )
  
      sys.stdout = codecs.getwriter("utf-8")(
          sys.stdout if is_python2 else sys.stdout.buffer
      )
      line = f.readline()
      n = args.nchar
      while line:
          x = line.split()
          print(" ".join(x[: args.skip_ncols]), end=" ")
          a = " ".join(x[args.skip_ncols :])
  
          # get all matched positions
          match_pos = []
          for r in rs:
              i = 0
              while i >= 0:
                  m = r.search(a, i)
                  if m:
                      match_pos.append([m.start(), m.end()])
                      i = m.end()
                  else:
                      break
  
          if args.trans_type == "phn":
              a = a.split(" ")
          else:
              if len(match_pos) > 0:
                  chars = []
                  i = 0
                  while i < len(a):
                      start_pos, end_pos = exist_or_not(i, match_pos)
                      if start_pos is not None:
                          chars.append(a[start_pos:end_pos])
                          i = end_pos
                      else:
                          chars.append(a[i])
                          i += 1
                  a = chars
  
              a = [a[j : j + n] for j in range(0, len(a), n)]
  
          a_flat = []
          for z in a:
              a_flat.append("".join(z))
  
          a_chars = [z.replace(" ", args.space) for z in a_flat]
          if args.trans_type == "phn":
              a_chars = [z.replace("sil", args.space) for z in a_chars]
          print(" ".join(a_chars))
          line = f.readline()
  
imports: import argparse
  import codecs
  import re
  import sys
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types