code: def build_argparse():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--data_dir",
          type=str,
          default="data/depparse",
          help="Root dir for saving models.",
      )
      parser.add_argument(
          "--wordvec_dir",
          type=str,
          default="extern_data/word2vec",
          help="Directory of word vectors.",
      )
      parser.add_argument(
          "--wordvec_file",
          type=str,
          default=None,
          help="Word vectors filename.",
      )
      parser.add_argument(
          "--wordvec_pretrain_file",
          type=str,
          default=None,
          help="Exact name of the pretrain file to read",
      )
      parser.add_argument(
          "--train_file",
          type=str,
          default=None,
          help="Input file for data loader.",
      )
      parser.add_argument(
          "--eval_file",
          type=str,
          default=None,
          help="Input file for data loader.",
      )
      parser.add_argument(
          "--output_file",
          type=str,
          default=None,
          help="Output CoNLL-U file.",
      )
      parser.add_argument(
          "--gold_file",
          type=str,
          default=None,
          help="Output CoNLL-U file.",
      )
  
      parser.add_argument(
          "--mode", default="train", choices=["train", "predict"]
      )
      parser.add_argument("--lang", type=str, help="Language")
      parser.add_argument(
          "--shorthand", type=str, help="Treebank shorthand"
      )
  
      parser.add_argument("--hidden_dim", type=int, default=400)
      parser.add_argument("--char_hidden_dim", type=int, default=400)
      parser.add_argument(
          "--deep_biaff_hidden_dim", type=int, default=400
      )
      parser.add_argument(
          "--composite_deep_biaff_hidden_dim", type=int, default=100
      )
      parser.add_argument("--word_emb_dim", type=int, default=75)
      parser.add_argument("--char_emb_dim", type=int, default=100)
      parser.add_argument("--tag_emb_dim", type=int, default=50)
      parser.add_argument("--transformed_dim", type=int, default=125)
      parser.add_argument("--num_layers", type=int, default=3)
      parser.add_argument("--char_num_layers", type=int, default=1)
      parser.add_argument(
          "--pretrain_max_vocab", type=int, default=250000
      )
      parser.add_argument("--word_dropout", type=float, default=0.33)
      parser.add_argument("--dropout", type=float, default=0.5)
      parser.add_argument(
          "--rec_dropout",
          type=float,
          default=0,
          help="Recurrent dropout",
      )
      parser.add_argument(
          "--char_rec_dropout",
          type=float,
          default=0,
          help="Recurrent dropout",
      )
  
      parser.add_argument(
          "--no_char",
          dest="char",
          action="store_false",
          help="Turn off character model.",
      )
      parser.add_argument(
          "--charlm",
          action="store_true",
          help="Turn on contextualized char embedding using pretrained character-level language model.",
      )
      parser.add_argument(
          "--charlm_save_dir",
          type=str,
          default="saved_models/charlm",
          help="Root dir for pretrained character-level language model.",
      )
      parser.add_argument(
          "--charlm_shorthand",
          type=str,
          default=None,
          help="Shorthand for character-level language model training corpus.",
      )
      parser.add_argument(
          "--charlm_forward_file",
          type=str,
          default=None,
          help="Exact path to use for forward charlm",
      )
      parser.add_argument(
          "--charlm_backward_file",
          type=str,
          default=None,
          help="Exact path to use for backward charlm",
      )
  
      parser.add_argument(
          "--bert_model",
          type=str,
          default=None,
          help="Use an external bert model (requires the transformers package)",
      )
      parser.add_argument(
          "--no_bert_model",
          dest="bert_model",
          action="store_const",
          const=None,
          help="Don't use bert",
      )
      parser.add_argument(
          "--bert_hidden_layers",
          type=int,
          default=None,
          help="How many layers of hidden state to use from the transformer",
      )
      parser.add_argument(
          "--bert_finetune",
          default=False,
          action="store_true",
          help="Finetune the bert (or other transformer)",
      )
      parser.add_argument(
          "--no_bert_finetune",
          dest="bert_finetune",
          action="store_false",
          help="Don't finetune the bert (or other transformer)",
      )
      parser.add_argument(
          "--bert_learning_rate",
          default=1.0,
          type=float,
          help="Scale the learning rate for transformer finetuning by this much",
      )
  
      parser.add_argument(
          "--no_pretrain",
          dest="pretrain",
          action="store_false",
          help="Turn off pretrained embeddings.",
      )
      parser.add_argument(
          "--no_linearization",
          dest="linearization",
          action="store_false",
          help="Turn off linearization term.",
      )
      parser.add_argument(
          "--no_distance",
          dest="distance",
          action="store_false",
          help="Turn off distance term.",
      )
  
      parser.add_argument(
          "--sample_train",
          type=float,
          default=1.0,
          help="Subsample training data.",
      )
      parser.add_argument(
          "--optim",
          type=str,
          default="adam",
          help="sgd, adagrad, adam or adamax.",
      )
      parser.add_argument(
          "--lr", type=float, default=3e-3, help="Learning rate"
      )
      parser.add_argument("--beta2", type=float, default=0.95)
  
      parser.add_argument("--max_steps", type=int, default=50000)
      parser.add_argument("--eval_interval", type=int, default=100)
      parser.add_argument(
          "--max_steps_before_stop", type=int, default=3000
      )
      parser.add_argument("--batch_size", type=int, default=5000)
      parser.add_argument(
          "--max_grad_norm",
          type=float,
          default=1.0,
          help="Gradient clipping.",
      )
      parser.add_argument(
          "--log_step",
          type=int,
          default=20,
          help="Print log every k steps.",
      )
      parser.add_argument(
          "--save_dir",
          type=str,
          default="saved_models/depparse",
          help="Root dir for saving models.",
      )
      parser.add_argument(
          "--save_name",
          type=str,
          default="{shorthand}_{embedding}_parser.pt",
          help="File name to save the model",
      )
  
      parser.add_argument("--seed", type=int, default=1234)
      utils.add_device_args(parser)
  
      parser.add_argument(
          "--augment_nopunct",
          type=float,
          default=None,
          help="Augment the training data by copying this fraction of punct-ending sentences as non-punct.  Default of None will aim for roughly 10%%",
      )
  
      parser.add_argument(
          "--wandb",
          action="store_true",
          help="Start a wandb session and write the results of training.  Only applies to training.  Use --wandb_name instead to specify a name",
      )
      parser.add_argument(
          "--wandb_name",
          default=None,
          help="Name of a wandb session to start when training.  Will default to the dataset short name",
      )
      return parser
  
imports: import sys
  import os
  import shutil
  import time
  import argparse
  import logging
  import numpy
  import random
  import torch
  from torch import nn, optim
  import stanza.models.depparse.data
  from stanza.models.depparse.data import DataLoader
  from stanza.models.depparse.trainer import Trainer
  from stanza.models.depparse import scorer
  from stanza.models.common import utils
  from stanza.models.common import pretrain
  from stanza.models.common.data import augment_punct
  from stanza.models.common.doc import *
  from stanza.utils.conll import CoNLL
  from stanza.models import _training_logging
label_desc: Use image node_id 1 for calling a global function with example usage: build_argparse() and returns: parser