Removes SaltStack params from **kwargs
972298
def _clean_data(data):
    '''
    
    '''
    for key in list(data):
        if key.startswith('__pub'):
            del data[key]
    return data
1365121
def ignores_kwargs(*kwarg_names):
    '''
    
    '''
    def _ignores_kwargs(fn):
        def __ignores_kwargs(*args, **kwargs):
            kwargs_filtered = kwargs.copy()
            for name in kwarg_names:
                if name in kwargs_filtered:
                    del kwargs_filtered[name]
            return fn(*args, **kwargs_filtered)
        return __ignores_kwargs
    return _ignores_kwargs
694602
def clearParameters(self):
        """"""
        self.beginRemoveRows(QtCore.QModelIndex(), 0, self.rowCount())
        self.model.clear_parameters()
        self.endRemoveRows()
247343
def filter(self, **kwargs):
        
        keys = self.filter_keys(**kwargs)
        return self.keys_to_values(keys)
1153073
def _deprecated_kwargs(kwargs, arg_newarg):
    
    warn_for = []
    for (arg, new_kw) in arg_newarg:
        if arg in kwargs.keys():
            val = kwargs.pop(arg)
            kwargs[new_kw] = val
            warn_for.append((arg, new_kw))
    if len(warn_for) > 0:
        if len(warn_for) == 1:
            warnings.warn("Argument '{}' is deprecated. Use {} instead".
                          format(warn_for[0][0], warn_for[0][1]),
                          DeprecationWarning, stacklevel=4)
        else:
            args = ", ".join([x[0] for x in warn_for])
            repl = ", ".join([x[1] for x in warn_for])
            warnings.warn(
                "Arguments '{}' are deprecated. Use '{}' instead respectively".
                format(args, repl),
                DeprecationWarning, stacklevel=4)
    return kwargs
792586
def _preprocess_kwargs(self, initial_kwargs):
        
        kwargs = initial_kwargs.copy()
        generic_key_related_kwargs = self._get_generic_key_related_kwargs(initial_kwargs)
        for key, value in generic_key_related_kwargs.items():
            # delete old kwarg that was related to generic key
            del kwargs[key]
            try:
                suffix = key.split('__')[1]
            except IndexError:
                suffix = None
            # add new kwargs that related to object_id and content_type fields
            new_kwargs = self._get_filter_object_id_and_content_type_filter_kwargs(value, suffix)
            kwargs.update(new_kwargs)

        return kwargs
344681
def ignore(self, argument_dest, **kwargs):
        
        self._check_stale()
        if not self._applicable():
            return

        dest_option = ['--__{}'.format(argument_dest.upper())]
        self.argument(argument_dest, arg_type=ignore_type, options_list=dest_option, **kwargs)
1026843
def param_remove(self, param: 'str') -> None:
        
        for attr in self._param_attr_dicts:
            if param in self.__dict__[attr]:
                self.__dict__[attr].pop(param)

        for attr in self._param_attr_lists:
            if param in self.__dict__[attr]:
                self.__dict__[attr].remove(param)
814916
def pop_key(self, arg, key, *args, **kwargs):
        
        return self.unfinished_arguments[arg].pop(key, *args, **kwargs)
1241894
def pop_kwargs(kwargs,
               names_with_defaults,  # type: List[Tuple[str, Any]]
               allow_others=False
               ):
    
    all_arguments = []
    for name, default_ in names_with_defaults:
        try:
            val = kwargs.pop(name)
        except KeyError:
            val = default_
        all_arguments.append(val)

    if not allow_others and len(kwargs) > 0:
        raise ValueError("Unsupported arguments: %s" % kwargs)

    if len(names_with_defaults) == 1:
        return all_arguments[0]
    else:
        return all_arguments
1335738
def flush(name, family='ipv4', **kwargs):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    for ignore in _STATE_INTERNAL_KEYWORDS:
        if ignore in kwargs:
            del kwargs[ignore]

    if 'table' not in kwargs:
        kwargs['table'] = 'filter'

    res = __salt__['nftables.check_table'](kwargs['table'], family=family)
    if not res['result']:
        ret['result'] = False
        ret['comment'] = 'Failed to flush table {0} in family {1}, table does not exist.'.format(
            kwargs['table'],
            family
        )
        return ret

    if 'chain' not in kwargs:
        kwargs['chain'] = ''
    else:
        res = __salt__['nftables.check_chain'](kwargs['table'],
                                               kwargs['chain'],
                                               family=family)
        if not res['result']:
            ret['result'] = False
            ret['comment'] = 'Failed to flush chain {0} in table {1} in family {2}, chain does not exist.'.format(
                kwargs['chain'],
                kwargs['table'],
                family
            )
            return ret

    res = __salt__['nftables.flush'](kwargs['table'],
                                     kwargs['chain'],
                                     family)
    if res['result']:
        ret['changes'] = {'locale': name}
        ret['result'] = True
        ret['comment'] = 'Flush nftables rules in {0} table {1} chain {2} family'.format(
            kwargs['table'],
            kwargs['chain'],
            family
        )
        return ret
    else:
        ret['result'] = False
        ret['comment'] = 'Failed to flush nftables rules'
        return ret
825532
def filter_empty_parameters(func):
    
    @wraps(func)
    def func_wrapper(self, *args, **kwargs):
        my_kwargs = {key: value for key, value in kwargs.items()
                     if value not in EMPTIES}
        args_is_empty = all(arg in EMPTIES for arg in args)

        if (
                {'source', 'material'}.issuperset(my_kwargs) or not my_kwargs
        ) and args_is_empty:
            return
        return func(self, *args, **my_kwargs)

    return func_wrapper
403730
def _clear_ignore(endpoint_props):
    '''
    
    '''
    return dict(
        (prop_name, prop_val)
        for prop_name, prop_val in six.iteritems(endpoint_props)
        if prop_name not in _DO_NOT_COMPARE_FIELDS and prop_val is not None
    )
47797
def del_key(cls, k):
        
        k = cls.__name__ + "__" + k
        session.pop(k)
278312
def rm_parameter(self, name):
        
        if name not in self._parameters:
            raise ValueError("no '%s' parameter found" % (name))

        del self._parameters[name]
        del self.__dict__[name]
432670
def _sanatize_network_params(self, kwargs):
        '''
        
        '''
        params = [
            'label', 'bridge', 'bridge_interface', 'cidr', 'cidr_v6', 'dns1',
            'dns2', 'fixed_cidr', 'gateway', 'gateway_v6', 'multi_host',
            'priority', 'project_id', 'vlan_start', 'vpn_start'
        ]

        for variable in six.iterkeys(kwargs):  # iterate over a copy, we might delete some
            if variable not in params:
                del kwargs[variable]
        return kwargs
376377
def _get_args(self, kwargs):
        '''
        
        '''
        _args = list()
        _kwargs = salt.utils.args.clean_kwargs(**kwargs)

        return _args, _kwargs