code: def _add_to_defaults(
      cls,
      a_parser,
      defaults,
      descriptions,
      arg_types,
      a_args=None,
      a_namespace=None,
      a_parsed_args=None,
  ):
      # noinspection PyProtectedMember
      actions = [
          a
          for a in a_parser._actions
          if isinstance(a, _StoreAction)
          or isinstance(a, _StoreConstAction)
      ]
      args_dict = {}
      # noinspection PyBroadException
      try:
          if isinstance(a_parsed_args, dict):
              args_dict = a_parsed_args
          else:
              if a_parsed_args:
                  args_dict = a_parsed_args.__dict__
              else:
                  args_dict = call_original_argparser(
                      a_parser, args=a_args, namespace=a_namespace
                  ).__dict__
          defaults_ = {
              a.dest: cls.__cast_arg(args_dict.get(a.dest), a.type)
              for a in actions
          }
      except Exception:
          # don't crash us if we failed parsing the inputs
          defaults_ = {
              a.dest: a.default if a.default is not None else ""
              for a in actions
          }
  
      desc_ = {
          a.dest: str(a.help)
          or (
              "{}default: {}".format(
                  "choices: {}, ".format(a.choices)
                  if a.choices
                  else "",
                  defaults_.get(a.dest, ""),
              )
          )
          for a in actions
      }
      descriptions.update(desc_)
      types_ = {a.dest: (a.type or None) for a in actions}
      arg_types.update(types_)
  
      full_args_dict = copy(defaults)
      full_args_dict.update(args_dict)
      defaults.update(defaults_)
  
      # deal with sub parsers
      # noinspection PyProtectedMember
      sub_parsers = [
          a
          for a in a_parser._actions
          if isinstance(a, _SubParsersAction)
      ]
      for sub_parser in sub_parsers:
          if sub_parser.dest and sub_parser.dest != SUPPRESS:
              defaults[sub_parser.dest] = (
                  full_args_dict.get(sub_parser.dest) or ""
              )
          for choice in sub_parser.choices.values():
              # recursively parse
              defaults, descriptions, arg_types = cls._add_to_defaults(
                  a_parser=choice,
                  defaults=defaults,
                  descriptions=descriptions,
                  arg_types=arg_types,
                  a_parsed_args=a_parsed_args or full_args_dict,
              )
  
      return defaults, descriptions, arg_types
  
imports: import yaml
  from enum import Enum
  from inspect import isfunction
  from six import PY2
  from argparse import _StoreAction, ArgumentError, _StoreConstAction, _SubParsersAction, _AppendAction, SUPPRESS
  from copy import copy
  from typing import Tuple, Type, Union
  from ...backend_api import Session
  from ...binding.args import call_original_argparser
  from ...utilities.proxy_object import get_type_from_basic_type_str
label_desc: Use image node_id 6 for calling the _Arguments obj's underlying member method code with example usage: obj._add_to_defaults(cls, a_parser, defaults, descriptions, arg_types, a_args, a_namespace, a_parsed_args) and returns: defaults,  descriptions,  arg_types