code: def check_args(arguments, data_frame):
      
      stripped_args = [a[0] for a in arguments]
      df = data_frame.df
      # first make sure all args are valid
      for a in arguments:
          if a[0] not in df.index:
              print("-I- ignoring invalid argument: {}".format(a[0]))
              print("-")
      # next make sure required arguments are present
      condition = df['reqd']
      reqd_args = df[condition]
      for arg in reqd_args['arg_name']:
          if arg not in stripped_args:
              raise pmag.MissingCommandLineArgException("-"+arg)
      #next, assign any default values as needed
  
      #condition = df['default'] != '' # don't need this, and sometimes the correct default argument IS ''
      default_args = df #[condition]
      using_defaults = []
      for arg_name, row in default_args.iterrows():
          default = row['default']
          if arg_name not in stripped_args:
              using_defaults.append(arg_name)
              arguments.append([arg_name, default])
      using_defaults = ["-" + arg for arg in using_defaults]
      print('Using default arguments for: {}'.format(', '.join(using_defaults)))
      return arguments
docs: check arguments against a command_line_dataframe.
      checks that:
      all arguments are valid
      all required arguments are present
      default values are used where needed