Deprecated. will change in-place keys for given args
        or all keys if `*` in args.
358115
def make_optional(self, *args):
        
        deprecated('This method is deprecated. You can not change keys instances.')
        for key in self.keys:
            if key.name in args or '*' in args:
                key.make_optional()
        return self
904670
def _update_file_args(self, file_mapping):
        """"""
        for key, value in self.args.items():
            new_value = file_mapping.get(value, value)
            if new_value != value:
                self.args[key] = new_value
1020250
def update_without_overwrite(d, *args, **kwds):
    
    if args:
        assert len(args) == 1, \
            'At most one positional parameter is allowed: {0!r}'.format(args)

        (other,) = args
        if isinstance(other, Mapping):
            for key in other:
                setitem_without_overwrite(d, key, other[key])
        elif hasattr(other, "keys"):
            for key in other.keys():
                setitem_without_overwrite(d, key, other[key])
        else:
            for key, value in other:
                setitem_without_overwrite(d, key, value)

    for key, value in kwds.items():
        setitem_without_overwrite(d, key, value)
647385
def replace_keys(d, keymap, force_snake_case):
    
    return {
        to_snake(keymap.get(k, k)) if force_snake_case else keymap.get(k, k):
            v for k, v in d.items()
    }
1234963
def _filter_kwargs(self, keep_list, **kwargs):
        ''' 
        '''
        new_kwargs = {}
        for argName, argVal in kwargs.items():
            if argName.lower() in keep_list:
                new_kwargs[argName.lower()] = argVal
        return new_kwargs
1223435
def _check_for_invalid_keys(fname, kwargs, compat_args):
    
    # set(dict) --> set of the dictionary's keys
    diff = set(kwargs) - set(compat_args)

    if diff:
        bad_arg = list(diff)[0]
        raise TypeError(("{fname}() got an unexpected "
                         "keyword argument '{arg}'".
                         format(fname=fname, arg=bad_arg)))
472134
def _translate_key(key):
    

    d = _get_deprecated_option(key)
    if d:
        return d.rkey or key
    else:
        return key
232592
def _replace_scalars_in_kwargs(self, kwargs):
        
        _check_type('kwargs', kwargs, dict)

        new_kwargs = {}
        for (name, value) in iteritems(kwargs):
            if isinstance(value, list):
                new_kwargs[name] = self._replace_scalars_in_args(value)
            elif isinstance(value, dict):
                new_kwargs[name] = self._replace_scalars_in_kwargs(value)
            elif isinstance(value, string_types):
                new_kwargs[name] = self._replace_scalar(value)
            else:
                new_kwargs[name] = value
        return new_kwargs
161080
def _check_unused_kwargs(self, kwargs):
        
        if len(kwargs.keys()) != 0:
            unused = ""
            for k in kwargs.keys():
                unused += "'%s', "%k
            if unused[-2:] == ", ":     # get rid of trailing comma
                unused = unused[:-2]
            raise Exception('Unused keys in kwargs: %s'%unused)
86974
def __regrab(changes):
    
    for wid, mods, kc in __keybinds.keys():
        if kc in changes:
            ungrab_key(wid, mods, kc)
            grab_key(wid, mods, changes[kc])

            old = (wid, mods, kc)
            new = (wid, mods, changes[kc])
            __keybinds[new] = __keybinds[old]
            del __keybinds[old]
529997
def filter_kwargs(keys, kwargs):
    
    for k in keys:
        if k in kwargs:
            yield (k, kwargs[k])
787709
function toMongooseArgs(args) {
  // Covert name_first to name: {first}
  let keyDepth = [];
  return (0, _entries2.default)(args).reduce((args, _ref7) => {
    var _ref8 = (0, _slicedToArray3.default)(_ref7, 2);

    let key = _ref8[0];
    let value = _ref8[1];

    keyDepth = key.split('_');
    if (keyDepth.length === 1) return (0, _assign2.default)(args, { [key]: value });
    keyDepth.reduce((args, depth, index) => {
      if (index === keyDepth.length - 1) {
        args[depth] = value;
        return;
      }
      args[depth] = args[depth] || {};
      return args[depth];
    }, args);
    return args;
  }, {});
}
673284
def update_kwargs(kwargs, **keyvalues):
    
    for key, value in keyvalues.items():
        if key not in kwargs:
            kwargs[key] = value
10298
def has_key(cls, *args):
        
        key = args if len(args) > 1 else args[0]
        return key in cls._instances
905086
def _full_rename(args):
    
    return (
        args.ns and
        all(map(args.rename.affects, args.ns))
    )
1310338
def pop_kwargs_with_prefix(prefix: str, kwargs: dict) -> dict:
    
    keys = [key for key in kwargs if key.startswith(prefix)]
    return {key[len(prefix):]: kwargs.pop(key) for key in keys}
145153
def replace(self, **kwargs):
        
        if 'usage_key' in kwargs:
            for attr in self.USAGE_KEY_ATTRS:
                kwargs.pop(attr, None)
        else:
            kwargs['usage_key'] = self.usage_key.replace(**{
                key: kwargs.pop(key)
                for key
                in self.USAGE_KEY_ATTRS
                if key in kwargs
            })
        return super(AsideUsageKeyV2, self).replace(**kwargs)