code: def main() -> None:
      if not exists(args.data_dir):
          raise ValueError(f"Data dir {args.data_dir} does not exist")
  
      # load errors vocabulary
      error_vcb = set()
      with open(args.errors_vocab_filename, "r", encoding="utf-8") as f:
          for line in f:
              cls, spoken, written = line.strip().split("\t")
              k = (cls, spoken, written)
              error_vcb.add(k)
  
      for subdir in listdir(args.data_dir):
          mkdir(join(args.out_dir, subdir))
          for filename in listdir(join(args.data_dir, subdir)):
              if not filename.startswith("output"):
                  continue
              inp_filename = join(args.data_dir, subdir, filename)
              out_filename = join(args.out_dir, subdir, filename)
              if not isfile(inp_filename):
                  continue
              filter_file(inp_filename, out_filename, error_vcb)
  
imports: from argparse import ArgumentParser
  from os import listdir, mkdir
  from os.path import exists, isfile, join
  from typing import Set
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types