code: def check_and_fill_args(args, arg_list, ds_class):
      """
      Fills in defaults based on an arguments list (e.g., TRAINING_ARGS) and a
      dataset class (e.g., datasets.CIFAR).
  
      Args:
          args (object) : Any object subclass exposing :samp:`setattr` and
              :samp:`getattr` (e.g. cox.utils.Parameters)
          arg_list (list) : A list of the same format as the lists above, i.e.
              containing entries of the form [NAME, TYPE/CHOICES, HELP, DEFAULT]
          ds_class (type) : A dataset class name (i.e. a
              :class:`robustness.datasets.DataSet` subclass name)
  
      Returns:
          args (object): The :samp:`args` object with all the defaults filled in according to :samp:`arg_list` defaults.
      """
      for arg_name, _, _, arg_default in arg_list:
          name = arg_name.replace("-", "_")
          if helpers.has_attr(args, name):
              continue
          if arg_default == REQ:
              raise ValueError(f"{arg_name} required")
          elif arg_default == BY_DATASET:
              setattr(args, name, TRAINING_DEFAULTS[ds_class][name])
          elif arg_default is not None:
              setattr(args, name, arg_default)
      return args
  
label_desc: Use image node_id 2 for calling a global function with example usage: check_and_fill_args(args, arg_list, ds_class) and returns: args