code: def parse_args(args=None):
      parser = argparse.ArgumentParser()
      parser.add_argument(
          "--batch_mode",
          help="custom settings when running in batch mode",
          action="store_true",
      )
      parser.add_argument(
          "--batch_size",
          help="batch size for training",
          type=int,
          default=64,
      )
      parser.add_argument(
          "--eval_length",
          help="length of strings to eval on",
          type=int,
          default=None,
      )
      parser.add_argument(
          "--eval_set", help="eval on dev or test", default="test"
      )
      parser.add_argument(
          "--data_dir",
          help="directory with train/dev/test data",
          default=None,
      )
      parser.add_argument(
          "--load_name", help="path to load model from", default=None
      )
      parser.add_argument(
          "--mode", help="train or eval", default="train"
      )
      parser.add_argument(
          "--num_epochs",
          help="number of epochs for training",
          type=int,
          default=50,
      )
      parser.add_argument(
          "--randomize",
          help="take random substrings of samples",
          action="store_true",
      )
      parser.add_argument(
          "--randomize_lengths_range",
          help="range of lengths to use when random sampling text",
          type=randomize_lengths_range,
          default="5,20",
      )
      parser.add_argument(
          "--merge_labels_for_eval",
          help='merge some language labels for eval (e.g. "zh-hans" and "zh-hant" to "zh")',
          action="store_true",
      )
      parser.add_argument(
          "--save_best_epochs",
          help="save model for every epoch with new best score",
          action="store_true",
      )
      parser.add_argument(
          "--save_name", help="where to save model", default=None
      )
      utils.add_device_args(parser)
      args = parser.parse_args(args=args)
      return args
  
file_path: stanza/stanza/models/lang_identifier.py
imports: import argparse
  import json
  import logging
  import os
  import random
  import torch
  from datetime import datetime
  from stanza.models.common import utils
  from stanza.models.langid.data import DataLoader
  from stanza.models.langid.trainer import Trainer
  from stanza.utils.get_tqdm import get_tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: parse_args(args) and returns: args