code: def setup_args(args):
      """
      Fill the args object with reasonable defaults from
      :mod:`robustness.defaults`, and also perform a sanity check to make sure no
      args are missing.
      """
      # override non-None values with optional config_path
      if args.config_path:
          args = cox.utils.override_json(args, args.config_path)
  
      ds_class = DATASETS[args.dataset]
      args = check_and_fill_args(args, defaults.CONFIG_ARGS, ds_class)
  
      if not args.eval_only:
          args = check_and_fill_args(
              args, defaults.TRAINING_ARGS, ds_class
          )
  
      if args.adv_train or args.adv_eval:
          args = check_and_fill_args(args, defaults.PGD_ARGS, ds_class)
  
      args = check_and_fill_args(
          args, defaults.MODEL_LOADER_ARGS, ds_class
      )
      if args.eval_only:
          assert (
              args.resume is not None
          ), "Must provide a resume path if only evaluating"
      return args
  
file_path: robustness/robustness/main.py
imports: from argparse import ArgumentParser
  import os
  import git
  import torch
  import cox
  import cox.utils
  import cox.store
label_desc: Use image node_id 2 for calling a global function with example usage: setup_args(args) and returns: args