code: def process_treebank(treebank, model_type, paths, args) -> None:
      """Process treebank."""
      if args.tag_method is Tags.GOLD:
          prepare_tokenizer_treebank.copy_conllu_treebank(
              treebank, model_type, paths, paths["DEPPARSE_DATA_DIR"]
          )
      elif args.tag_method is Tags.PREDICTED:
          short_name = treebank_to_short_name(treebank)
          short_language, dataset = short_name.split("_")
  
          # fmt: off
          base_args = ["--wordvec_dir", paths["WORDVEC_DIR"],
                       "--lang", short_language,
                       "--shorthand", short_name,
                       "--mode", "predict"]
          # fmt: on
  
          # perhaps download a tagger if one doesn't already exist
          tagger_model = choose_tagger_model(
              short_language, dataset, args.tagger_model, args
          )
          if tagger_model is None:
              raise FileNotFoundError(
                  "Cannot find a tagger for language %s, dataset %s - you can specify one with the --tagger_model flag"
              )
          else:
              logger.info(
                  "Using tagger model in %s for %s_%s",
                  tagger_model,
                  short_language,
                  dataset,
              )
          tagger_dir, tagger_name = os.path.split(tagger_model)
          base_args = base_args + [
              "--save_dir",
              tagger_dir,
              "--save_name",
              tagger_name,
          ]
  
          # word vector file for POS
          if args.wordvec_pretrain_file:
              base_args += [
                  "--wordvec_pretrain_file",
                  args.wordvec_pretrain_file,
              ]
          else:
              base_args = base_args + wordvec_args(
                  short_language, dataset, []
              )
  
          # charlm for POS
          charlm = choose_charlm(
              short_language,
              dataset,
              args.charlm,
              default_charlms,
              pos_charlms,
          )
          charlm_args = build_charlm_args(short_language, charlm)
          base_args = base_args + charlm_args
  
          def retag_dataset(
              tokenizer_dir,
              tokenizer_file,
              dest_dir,
              dest_file,
              short_name,
          ):
              original = f"{tokenizer_dir}/{short_name}.{tokenizer_file}.conllu"
              retagged = f"{dest_dir}/{short_name}.{dest_file}.conllu"
              # fmt: off
              tagger_args = ["--eval_file", original,
                             "--output_file", retagged]
              # fmt: on
              tagger_args = base_args + tagger_args
              logger.info(
                  "Running tagger to retag {} to {}\n  Args: {}".format(
                      original, retagged, tagger_args
                  )
              )
              tagger.main(tagger_args)
  
          prepare_tokenizer_treebank.copy_conllu_treebank(
              treebank,
              model_type,
              paths,
              paths["DEPPARSE_DATA_DIR"],
              retag_dataset,
          )
      else:
          raise ValueError(
              "Unknown tags method: {}".format(args.tag_method)
          )
  
file_path: stanza/stanza/utils/datasets/prepare_depparse_treebank.py
imports: from enum import Enum
  import glob
  import logging
  import os
  from stanza.models import tagger
  from stanza.models.common.constant import treebank_to_short_name
  from stanza.resources.common import download, DEFAULT_MODEL_DIR
  from stanza.resources.default_packages import default_charlms, pos_charlms
  import stanza.utils.datasets.common
  import stanza.utils.datasets.prepare_tokenizer_treebank
  from stanza.utils.training.run_pos import wordvec_args
  from stanza.utils.training.common import add_charlm_args, build_charlm_args, choose_charlm
label_desc: Use image node_id 3 for calling a global function with example usage: process_treebank(treebank, model_type, paths, args) without return types