code: def process_vlsp22(paths, dataset_name, *args):
      """
      Processes the VLSP 2022 dataset, which is four separate files for some reason
      """
      assert dataset_name == "vi_vlsp22" or dataset_name == "vi_vlsp23"
  
      if dataset_name == "vi_vlsp22":
          default_subdir = "VLSP_2022"
          default_make_test_split = False
          updated_tagset = False
      elif dataset_name == "vi_vlsp23":
          default_subdir = os.path.join("VLSP_2023", "Trainingdataset")
          default_make_test_split = True
          updated_tagset = True
  
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--subdir",
          default=default_subdir,
          type=str,
          help="Where to find the data - allows for using previous versions, if needed",
      )
      parser.add_argument(
          "--no_convert_brackets",
          default=True,
          action="store_false",
          dest="convert_brackets",
          help="Don't convert the VLSP parens RKBT & LKBT to PTB parens",
      )
      parser.add_argument(
          "--n_splits",
          default=None,
          type=int,
          help="Split the data into this many pieces.  Relevant as there is no set training/dev split, so this allows for N models on N different dev sets",
      )
      parser.add_argument(
          "--test_split",
          default=default_make_test_split,
          action="store_true",
          help="Split 1/10th of the data as a test split as well.  Useful for experimental results.  Less relevant since there is now an official test set",
      )
      parser.add_argument(
          "--no_test_split",
          dest="test_split",
          action="store_false",
          help="Split 1/10th of the data as a test split as well.  Useful for experimental results.  Less relevant since there is now an official test set",
      )
      args = parser.parse_args(args=list(*args))
  
      if os.path.exists(args.subdir):
          vlsp_dir = args.subdir
      else:
          vlsp_dir = os.path.join(
              paths["CONSTITUENCY_BASE"], "vietnamese", args.subdir
          )
      if not os.path.exists(vlsp_dir):
          raise FileNotFoundError(
              "Could not find the {} dataset in the expected location of {} - CONSTITUENCY_BASE == {}".format(
                  dataset_name, vlsp_dir, paths["CONSTITUENCY_BASE"]
              )
          )
      vlsp_files = os.listdir(vlsp_dir)
      vlsp_test_files = [
          os.path.join(vlsp_dir, x)
          for x in vlsp_files
          if x.startswith("private") and not x.endswith(".zip")
      ]
      vlsp_train_files = [
          os.path.join(vlsp_dir, x)
          for x in vlsp_files
          if x.startswith("file") and not x.endswith(".zip")
      ]
      vlsp_train_files.sort()
      if len(vlsp_train_files) == 0:
          raise FileNotFoundError(
              "No train files (files starting with 'file') found in {}".format(
                  vlsp_dir
              )
          )
      if not args.test_split and len(vlsp_test_files) == 0:
          raise FileNotFoundError(
              "No test files found in {}".format(vlsp_dir)
          )
      print("Loading training files from {}".format(vlsp_dir))
      print(
          "Procesing training files:\n  {}".format(
              "\n  ".join(vlsp_train_files)
          )
      )
      with tempfile.TemporaryDirectory() as train_output_path:
          vtb_convert.convert_files(
              vlsp_train_files,
              train_output_path,
              verbose=True,
              fix_errors=True,
              convert_brackets=args.convert_brackets,
              updated_tagset=updated_tagset,
          )
          # This produces a 0 length test set, just as a placeholder until the actual test set is released
          if args.n_splits:
              test_size = 0.1 if args.test_split else 0.0
              dev_size = (1.0 - test_size) / args.n_splits
              train_size = 1.0 - test_size - dev_size
              for rotation in range(args.n_splits):
                  # there is a shuffle inside the split routine,
                  # so we need to reset the random seed each time
                  random.seed(1234)
                  rotation_name = "%s-%d-%d" % (
                      dataset_name,
                      rotation,
                      args.n_splits,
                  )
                  if args.test_split:
                      rotation_name = rotation_name + "t"
                  vtb_split.split_files(
                      train_output_path,
                      paths["CONSTITUENCY_DATA_DIR"],
                      rotation_name,
                      train_size=train_size,
                      dev_size=dev_size,
                      rotation=(rotation, args.n_splits),
                  )
          else:
              test_size = 0.1 if args.test_split else 0.0
              dev_size = 0.1
              train_size = 1.0 - test_size - dev_size
              if args.test_split:
                  dataset_name = dataset_name + "t"
              vtb_split.split_files(
                  train_output_path,
                  paths["CONSTITUENCY_DATA_DIR"],
                  dataset_name,
                  train_size=train_size,
                  dev_size=dev_size,
              )
  
      if not args.test_split:
          print(
              "Procesing test files:\n  {}".format(
                  "\n  ".join(vlsp_test_files)
              )
          )
          with tempfile.TemporaryDirectory() as test_output_path:
              vtb_convert.convert_files(
                  vlsp_test_files,
                  test_output_path,
                  verbose=True,
                  fix_errors=True,
                  convert_brackets=args.convert_brackets,
              )
              if args.n_splits:
                  for rotation in range(args.n_splits):
                      rotation_name = "%s-%d-%d" % (
                          dataset_name,
                          rotation,
                          args.n_splits,
                      )
                      vtb_split.split_files(
                          test_output_path,
                          paths["CONSTITUENCY_DATA_DIR"],
                          rotation_name,
                          train_size=0,
                          dev_size=0,
                      )
              else:
                  vtb_split.split_files(
                      test_output_path,
                      paths["CONSTITUENCY_DATA_DIR"],
                      dataset_name,
                      train_size=0,
                      dev_size=0,
                  )
  
imports: import argparse
  import os
  import random
  import sys
  import tempfile
  from tqdm import tqdm
  from stanza.models.constituency import parse_tree
  import stanza.utils.default_paths
  from stanza.models.constituency import tree_reader
  from stanza.models.constituency.parse_tree import Tree
  from stanza.server import tsurgeon
  from stanza.utils.datasets.constituency import utils
  from stanza.utils.datasets.constituency.convert_alt import convert_alt
  from stanza.utils.datasets.constituency.convert_arboretum import convert_tiger_treebank
  from stanza.utils.datasets.constituency.convert_cintil import convert_cintil_treebank
  import stanza.utils.datasets.constituency.convert_ctb
  from stanza.utils.datasets.constituency.convert_it_turin import convert_it_turin
  from stanza.utils.datasets.constituency.convert_it_vit import convert_it_vit
  from stanza.utils.datasets.constituency.convert_starlang import read_starlang
  from stanza.utils.datasets.constituency.utils import SHARDS, write_dataset
  import stanza.utils.datasets.constituency.vtb_convert
  import stanza.utils.datasets.constituency.vtb_split
label_desc: Use image node_id 5 for calling a global function with example usage: process_vlsp22(paths, dataset_name) without return types