set args from config object. it recursively checks nested objects.
340560
function setConfigObject (config, prev) {
    Object.keys(config).forEach(function (key) {
      var value = config[key]
      var fullKey = prev ? prev + '.' + key : key

      // if the value is an inner object and we have dot-notation
      // enabled, treat inner objects in config the same as
      // heavily nested dot notations (foo.bar.apple).
      if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
        // if the value is an object but not an array, check nested object
        setConfigObject(value, fullKey)
      } else {
        // setting arguments via CLI takes precedence over
        // values within the config file.
        if (!hasKey(argv, fullKey.split('.')) || (flags.defaulted[fullKey]) || (flags.arrays[fullKey] && configuration['combine-arrays'])) {
          setArg(fullKey, value)
        }
      }
    })
  }
730391
def takes_arg(obj, arg: str) -> bool:
    
    if inspect.isclass(obj):
        signature = inspect.signature(obj.__init__)
    elif inspect.ismethod(obj) or inspect.isfunction(obj):
        signature = inspect.signature(obj)
    else:
        raise ConfigurationError(f"object {obj} is not callable")
    return arg in signature.parameters
607166
public void setArgs(String[] args) {
        if (args == null) {
            args = new String[]{};
        }
        this.args = args;
        this.argsList = Collections.unmodifiableList(new ArrayList<String>(Arrays.asList(args)));
    }
425861
def do_config(self, arg):
        
        if arg['print']:
            self.print_config(arg)
        elif arg['reload']:
            self.reload_config(arg)
        else:
            self.help_server()
155919
def set_config(config, overwrite=False):
    '''
    
    '''

    if config is None:
        config = get_conf_path_from_env()

    # must be after the fallback other a bad fallback will incorrectly clear
    if overwrite is True:
        _runtime_conf.empty()

    if isinstance(config, six.string_types):
        config = conf_from_file(config)
        _runtime_conf.update(config)
        if config.__file__:
            _runtime_conf.__file__ = config.__file__
    elif isinstance(config, dict):
        _runtime_conf.update(conf_from_dict(config))
    else:
        raise TypeError('%s is neither a dictionary or a string.' % config)
968069
def config_arg(arguments, key, default = nil)
      value = if arguments[key].present?
        arguments[key]
      else
        configuration[key]
      end

      value = value.to_s if value.kind_of? Symbol

      return value
    end
1010563
public function setConfigs(array $args) {
        if (!is_array(current($args))) {
            $args = [
                $this->currentName => $args
            ];
        }
        foreach ($args as $key => $item) {
            if (array_key_exists($key, $this->configs)) {
                $this->configs[$key] = array_merge($this->configs[$key], $item);
            } else {
                $this->configs[$key] = $item;
            }
        }
        return $this;
    }
1068327
def from_args(cls: Type[ConfigT], args: Namespace) -> ConfigT:
        
        parsed_args = cls.parse_args(args)
        return cls(args, host=args.host, port=args.port, debug=args.debug,
                   reject_insecure_auth=not args.insecure_login,
                   cert_file=args.cert, key_file=args.key,
                   **parsed_args)
335489
def with_known_args(self, **kwargs):
    """"""
    argspec = inspect.getargspec(self.func)
    stored = {}
    for key, arg in six.iteritems(kwargs):
      if key in argspec.args or argspec.keywords:
        stored[key] = arg
    if stored:
      return self.with_args(**stored)
    return self
781467
def __store_config(self, args, kwargs):
        
        signature = (
            'schema',
            'ignore_none_values',
            'allow_unknown',
            'require_all',
            'purge_unknown',
            'purge_readonly',
        )
        for i, p in enumerate(signature[: len(args)]):
            if p in kwargs:
                raise TypeError("__init__ got multiple values for argument " "'%s'" % p)
            else:
                kwargs[p] = args[i]
        self._config = kwargs
        """ This dictionary holds the configuration arguments that were used to
            initialize the :class:`Validator` instance except the
            ``error_handler``. """
311863
async def set_config(self, config):
        
        config_facade = client.ModelConfigFacade.from_connection(
            self.connection()
        )
        for key, value in config.items():
            if isinstance(value, ConfigValue):
                config[key] = value.value
        await config_facade.ModelSet(config)
701033
def check_arguments(cls, conf):
        
        try:
            # Check we have access to the config file
            f = open(conf['file'], "r")
            f.close()
        except IOError as e:
            raise ArgsError("Cannot open config file '%s': %s" %
                            (conf['file'], e))
29042
def _settings_from_args(self, args):
        """"""
        if not args:
            return {}

        from_args = {}
        if args.yes:
            from_args['require_confirmation'] = not args.yes
        if args.debug:
            from_args['debug'] = args.debug
        if args.repeat:
            from_args['repeat'] = args.repeat
        return from_args
510140
def parse_args(self, command_selected, flags, _free_args):
        # type: (str, Dict[str, str], List[str]) -> bool
        
        configs = self.function_name_to_configs[command_selected]
        suggested_configs = self.function_name_to_suggest_configs[command_selected]

        # create the attribute_to_config map
        attribute_to_config = dict()  # type: Dict[str, Config]
        for config in itertools.chain(configs, suggested_configs):
            for attribute in config.get_attributes():
                if attribute in attribute_to_config:
                    raise ValueError("attribute [{}] double".format(attribute))
                attribute_to_config[attribute] = config

        # set the flags into the "default" field
        unknown_flags = []
        for flag_raw, value in flags.items():
            edit = value.startswith('=')
            if flag_raw not in attribute_to_config:
                unknown_flags.append(flag_raw)
            config = attribute_to_config[flag_raw]
            param = config.get_param_by_name(flag_raw)
            if edit:
                v = param.s2t_generate_from_default(value[1:])
            else:
                v = param.s2t(value)
            setattr(config, flag_raw, v)

        # check for missing parameters and show help if there are any missing
        missing_parameters = []
        for config in configs:
            for attribute in config.get_attributes():
                value = getattr(config, attribute)
                if value is NO_DEFAULT:
                    missing_parameters.append(attribute)
        if unknown_flags or missing_parameters:
            if missing_parameters:
                print()
                print_warn("missing parameters [{}]".format(",".join(missing_parameters)))
            if unknown_flags:
                print()
                print_warn("unknown flags [{}]".format(",".join(unknown_flags)))
            print("problems found, not running")
            print()
            self.show_help_for_function(command_selected, show_help_full=False, show_help_suggest=False)
            return False

        # move all default values to place
        for config in itertools.chain(configs, self._configs):
            for attribute in config.get_attributes():
                param = getattr(config, attribute)  # type: Param
                if isinstance(param, Param):
                    if param.default is not NO_DEFAULT:
                        setattr(config, attribute, param.default)
        return True
1112618
def update_args(self, args):
        
        for cfg in args:
            keys, v = cfg.split('=', maxsplit=1)
            keylist = keys.split('.')

            dic = self
            for i, k in enumerate(keylist[:-1]):
                assert k in dir(dic), "Unknown config key: {}".format(keys)
                dic = getattr(dic, k)
            key = keylist[-1]

            oldv = getattr(dic, key)
            if not isinstance(oldv, str):
                v = eval(v)
            setattr(dic, key, v)
682875
public void setArgs(java.util.Collection<CodeGenNodeArg> args) {
        if (args == null) {
            this.args = null;
            return;
        }

        this.args = new java.util.ArrayList<CodeGenNodeArg>(args);
    }
328486
def global_config(cls, key, *args):
        '''  '''
        if args:
            cls.settings[key] = args[0]
        else:
            return cls.settings[key]