code: def parse_args(argv):
      """Parses command line arguments."""
      parser = argparse.ArgumentParser(
          formatter_class=argparse.ArgumentDefaultsHelpFormatter
      )
      parser.add_argument(
          "--config",
          required=True,
          choices=configs.valid_configs(),
          help="The config to use.",
      )
      parser.add_argument(
          "--ckpt_dir",
          required=True,
          help=(
              "Path to the folder where checkpoints should be "
              "stored. Passing the same folder twice will resume "
              "training."
          ),
      )
      parser.add_argument(
          "--num_steps",
          default="1M",
          help=(
              "Number of steps to train for. Supports M and k "
              'postfix for "million" and "thousand", resp.'
          ),
      )
      parser.add_argument(
          "--init_autoencoder_from_ckpt_dir",
          metavar="AUTOENC_CKPT_DIR",
          help=(
              "If given, restore encoder, decoder, and "
              "probability model from the latest checkpoint in "
              "AUTOENC_CKPT_DIR. See README.md."
          ),
      )
      parser.add_argument(
          "--batch_size",
          type=int,
          default=8,
          help="Batch size for training.",
      )
      parser.add_argument(
          "--crop_size",
          type=int,
          default=256,
          help="Crop size for input pipeline.",
      )
      parser.add_argument(
          "--lpips_weight_path",
          help=(
              "Where to store the LPIPS weights. Defaults to "
              "current directory"
          ),
      )
  
      helpers.add_tfds_arguments(parser)
  
      parser.add_argument(
          "--no-image-summaries",
          dest="image_summaries",
          action="store_false",
          help="Disable image summaries.",
      )
      parser.set_defaults(image_summaries=True)
  
      args = parser.parse_args(argv[1:])
      if args.ckpt_dir == args.init_autoencoder_from_ckpt_dir:
          raise ValueError(
              "--init_autoencoder_from_ckpt_dir should not point to "
              "the same folder as --ckpt_dir. If you simply want to "
              "continue training the model in --ckpt_dir, you do not "
              "have to pass --init_autoencoder_from_ckpt_dir, as "
              "continuing training is the default."
          )
      args.num_steps = _parse_num_steps(args.num_steps)
      return args
  
file_path: compression/models/hific/train.py
imports: import argparse
  import sys
  import tensorflow.compat.v1
  from hific import configs
  from hific import helpers
  from hific import model
label_desc: Use image node_id 2 for calling a global function with example usage: parse_args(argv) and returns: args