code: def establish_args():
      parser = argparse.ArgumentParser()
      # dynet global setting
      parser.add_argument("--dynet-seed", default=0, type=int)
      parser.add_argument("--dynet-mem", default=512, type=int)
      parser.add_argument("--dynet-gpus", default=0, type=int)
      parser.add_argument("--dynet-autobatch", default=0, type=int)
  
      # control parameters
      parser.add_argument(
          "--mode",
          default="train",
          help="available modes: [train, test]",
      )
      parser.add_argument("--model_meta_file", default=None, type=str)
  
      # scheduler parameters
      parser.add_argument(
          "--trainer",
          default="AdagradTrainer",
          help="trainer name in dynet",
      )
      parser.add_argument(
          "--sparse", default=1, type=int, help="sparse update 0/1"
      )
      parser.add_argument(
          "--learning_rate_param", default=0.05, type=float
      )
      parser.add_argument(
          "--learning_rate_embed", default=0.005, type=float
      )
      parser.add_argument("--save_dir", default="saved_models")
      parser.add_argument("--batch_size", default=25, type=int)
      parser.add_argument(
          "--regularization_strength", default=1e-4, type=float
      )
  
      # model parameters
      parser.add_argument(
          "--use_glove",
          default=False,
          action="store_true",
          help="Use glove vectors or not.",
      )
      parser.add_argument("--dropout_rate", default=0.3, type=float)
      parser.add_argument(
          "--wembed_size", default=300, type=int, help="embedding size"
      )
      parser.add_argument(
          "--hidden_size", default=150, type=int, help="hidden size"
      )
  
      args = parser.parse_args()
  
      # check and ensure feasibility
      if args.use_glove and args.wembed_size != 300:
          warnings.warn(
              "Warning: word embedding size must be 300 when using glove, auto adjusted."
          )
          args.wembed_size = 300
      if args.mode not in ["train", "test"]:
          raise ValueError("Wrong mode, [train, test] available now")
      if args.mode == "test":
          if args.model_meta_file is None:
              raise ValueError("Missing model meta file to load")
      else:
          meta_path = os.path.join(args.save_dir, "meta")
          param_path = os.path.join(args.save_dir, "param")
          embed_path = os.path.join(args.save_dir, "embed")
          if not os.path.exists(meta_path):
              os.makedirs(meta_path)
          if not os.path.exists(param_path):
              os.makedirs(param_path)
          if not os.path.exists(embed_path):
              os.makedirs(embed_path)
      return args
  
file_path: dynet/examples/treelstm/main.py
imports: from __future__ import print_function
  import dynet
  import sys
  import time
  import os
  import argparse
  import warnings
  import zipfile
  from six.moves import urllib
  from model import TreeLSTMClassifier
  from utils import get_embeds, acc_eval
  from scheduler import Scheduler
  from dataloader import DataLoader
label_desc: Use image node_id 2 for calling a global function with example usage: establish_args() and returns: args