code: def build_argparse():
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--data_dir",
          type=str,
          default="data/mwt",
          help="Root dir for saving models.",
      )
      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(
          "--no_dict",
          dest="ensemble_dict",
          action="store_false",
          help="Do not ensemble dictionary with seq2seq. By default ensemble a dict.",
      )
      parser.add_argument(
          "--ensemble_early_stop",
          action="store_true",
          help="Early stopping based on ensemble performance.",
      )
      parser.add_argument(
          "--dict_only",
          action="store_true",
          help="Only train a dictionary-based MWT expander.",
      )
  
      parser.add_argument("--hidden_dim", type=int, default=100)
      parser.add_argument("--emb_dim", type=int, default=50)
      parser.add_argument("--num_layers", type=int, default=1)
      parser.add_argument("--emb_dropout", type=float, default=0.5)
      parser.add_argument("--dropout", type=float, default=0.5)
      parser.add_argument("--max_dec_len", type=int, default=50)
      parser.add_argument("--beam_size", type=int, default=1)
      parser.add_argument(
          "--attn_type",
          default="soft",
          choices=["soft", "mlp", "linear", "deep"],
          help="Attention type",
      )
      parser.add_argument(
          "--no_copy",
          dest="copy",
          action="store_false",
          help="Do not use copy mechanism in MWT expansion. By default copy mechanism is used to improve generalization.",
      )
  
      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=1e-3, help="Learning rate"
      )
      parser.add_argument("--lr_decay", type=float, default=0.9)
      parser.add_argument(
          "--decay_epoch",
          type=int,
          default=30,
          help="Decay the lr starting from this epoch.",
      )
      parser.add_argument("--num_epoch", type=int, default=30)
      parser.add_argument("--batch_size", type=int, default=50)
      parser.add_argument(
          "--max_grad_norm",
          type=float,
          default=5.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/mwt",
          help="Root dir for saving models.",
      )
      parser.add_argument(
          "--save_name",
          type=str,
          default=None,
          help="File name to save the model",
      )
  
      parser.add_argument("--seed", type=int, default=1234)
      utils.add_device_args(parser)
  
      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
  from datetime import datetime
  import argparse
  import logging
  import numpy
  import random
  import torch
  from torch import nn, optim
  import copy
  from stanza.models.mwt.data import DataLoader
  from stanza.models.mwt.vocab import Vocab
  from stanza.models.mwt.trainer import Trainer
  from stanza.models.mwt import scorer
  from stanza.models.common import utils
  import stanza.models.common.seq2seq_constant
  from stanza.models.common.doc import Document
  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