class_docstr: Provide an opt-producer and CLI argument parser.
  
  Pseudo-extension of ``argparse`` which sets a number of parameters
  for the ParlAI framework. More options can be added specific to other
  modules by passing this object and calling ``add_arg()`` or
  ``add_argument()`` on it.
  
  For an example, see ``parlai.core.dict.DictionaryAgent.add_cmdline_args``.
  
  :param add_parlai_args:
      (default True) initializes the default arguments for ParlAI
      package, including the data download paths and task arguments.
  :param add_model_args:
      (default False) initializes the default arguments for loading
      models, including initializing arguments from that model.
class_docstr_tok: ["Provide","an","opt-producer","and","CLI","argument","parser",".","Pseudo-extension","of","``","argparse","``","which","sets","a","number","of","parameters","for","the","ParlAI","framework",".","More","options","can","be","added","specific","to","other","modules","by","passing","this","object","and","calling","``","add_arg","(",")","``","or","``","add_argument","(",")","``","on","it",".","For","an","example",",","see","``","parlai.core.dict.DictionaryAgent.add_cmdline_args","``",".",":","param","add_parlai_args",":","(","default","True",")","initializes","the","default","arguments","for","ParlAI","package",",","including","the","data","download","paths","and","task","arguments",".",":","param","add_model_args",":","(","default","False",")","initializes","the","default","arguments","for","loading","models",",","including","initializing","arguments","from","that","model","."]
code: def _process_args_to_opts(
      self, args_that_override: Optional[List[str]] = None
  ):
      self.opt = Opt(vars(self.args))
      extra_ag = []
  
      if "_subparser" in self.opt:
          # if using the super command, we need to be aware of the subcommand's
          # arguments when identifying things manually set by the user
          self.overridable.update(self.opt["_subparser"].overridable)
          extra_ag = self.opt.pop("_subparser")._action_groups
  
      # custom post-parsing
      self.opt["parlai_home"] = self.parlai_home
      self.opt = self._infer_datapath(self.opt)
  
      # set all arguments specified in command line as overridable
      option_strings_dict = {}
      store_true = []
      store_false = []
      for group in self._action_groups + extra_ag:
          for a in group._group_actions:
              if hasattr(a, "option_strings"):
                  for option in a.option_strings:
                      option_strings_dict[option] = a.dest
                      if isinstance(a, argparse._StoreTrueAction):
                          store_true.append(option)
                      elif isinstance(a, argparse._StoreFalseAction):
                          store_false.append(option)
  
      if args_that_override is None:
          args_that_override = _sys.argv[1:]
  
      args_that_override = self._handle_single_dash_parsearg(
          fix_underscores(args_that_override),
          option_strings_dict.keys(),
      )
  
      for i in range(len(args_that_override)):
          if args_that_override[i] in option_strings_dict:
              if args_that_override[i] in store_true:
                  self.overridable[
                      option_strings_dict[args_that_override[i]]
                  ] = True
              elif args_that_override[i] in store_false:
                  self.overridable[
                      option_strings_dict[args_that_override[i]]
                  ] = False
              elif (
                  i < len(args_that_override) - 1
                  and args_that_override[i + 1]
                  not in option_strings_dict
              ):
                  key = option_strings_dict[args_that_override[i]]
                  self.overridable[key] = self.opt[key]
      self.opt["override"] = self.overridable
  
      # load opts if a file is provided.
      if self.opt.get("init_opt", None) is not None:
          self._load_opts(self.opt)
  
      # map filenames that start with 'zoo:' to point to the model zoo dir
      options_to_change = {
          "model_file",
          "dict_file",
          "bpe_vocab",
          "bpe_merge",
      }
      for each_key in options_to_change:
          if self.opt.get(each_key) is not None:
              self.opt[each_key] = modelzoo_path(
                  self.opt.get("datapath"), self.opt[each_key]
              )
          if self.opt["override"].get(each_key) is not None:
              # also check override
              self.opt["override"][each_key] = modelzoo_path(
                  self.opt.get("datapath"),
                  self.opt["override"][each_key],
              )
  
      # add start time of an experiment
      self.opt["starttime"] = datetime.datetime.today().strftime(
          "%b%d_%H-%M"
      )
  
imports: import argparse
  import importlib
  import os
  import sys
  import datetime
  import parlai
  import parlai.utils.logging
  from parlai.core.build_data import modelzoo_path
  from parlai.core.loader import load_teacher_module, load_agent_module, load_world_module
  from parlai.tasks.tasks import ids_to_tasks
  from parlai.core.opt import Opt
  from parlai.utils.io import PathManager
  from typing import List, Optional
label_desc: Use image node_id 20 for calling the ParlaiParser obj's underlying member method code with example usage: obj._process_args_to_opts(args_that_override) without return types