:param m_args:   values to match args against
    :param m_kwargs: values to match kwargs against
    :param arg: args to match
    :param arg: kwargs to match
342491
def args_match(m_args, m_kwargs, default, *args, **kwargs):
    
    if len(m_args) > len(args):
        return False
    for m_arg, arg in zip(m_args, args):
        matches = arg_match(m_arg, arg, eq)
        if not matches or matches is InvalidArg:
            return False  # bail out

    if m_kwargs:
        for name, m_arg in m_kwargs.items():
            name, comparator = arg_comparitor(name)
            arg = kwargs.get(name)
            if not arg_match(m_arg, arg, comparator, default):
                return False  # bail out
    return True
1190341
def match(m_templ, *m_args):
    
    # strip commented lines
    m_templ = '\n'.join(line for line in m_templ.splitlines()
                        if not line.lstrip().startswith('--'))
    if not m_args:
        return m_templ, ()
    try:
        return _Replacer(m_args).match(m_templ)
    except IndexError:
        raise ValueError('Incorrect number of ?-parameters in %s, expected %s'
                         % (m_templ, len(m_args)))
728966
def _convert_args(args):
    '''
    
    '''
    converted = []
    for arg in args:
        if isinstance(arg, dict):
            for key in list(arg.keys()):
                if key == '__kwarg__':
                    continue
                converted.append('{0}={1}'.format(key, arg[key]))
        else:
            converted.append(arg)
    return converted
865046
def is_argument(self, name):
        
        if name == self.vararg:
            return True
        if name == self.kwarg:
            return True
        return (
            self.find_argname(name, True)[1] is not None
            or self.kwonlyargs
            and _find_arg(name, self.kwonlyargs, True)[1] is not None
        )
115053
def assert_matches(self, *args, **kwargs):
        
        matcher = make_matcher(*args, **kwargs)
        if not matcher.matches(self):
            raise AssertionError('%r does not match %r' % (self, matcher))
        return self
1123274
def check_arguments(self):
        
        for k, v in self.Parameters.iteritems():
            if self.Parameters[k].isOn():
                if k in self._valid_arguments:
                    if not self._valid_arguments[k](v.Value):
                        error_message = 'Invalid argument (%s) ' % v.Value
                        error_message += 'for parameter %s\n' % k
                        raise InvalidArgumentApplicationError(error_message)
136906
def prepare_args(self, args, kwargs):
        
        args, kwargs = super().prepare_args(args, kwargs)
        form_kwargs = self.get_form_kwargs()
        self.form = self.Form(**form_kwargs)
        return args, kwargs
1293823
def input(self, *args, **kwargs):
        
        errors = []

        if args and self.arg_names:
            args = list(args)
            # Replace args inline that have adapters
            for i, (key, val) in enumerate(izip(self.arg_names, args)):
                try:
                    args[i] = self._adapt_param(key, val)
                except AnticipateParamError as e:
                    errors.append(e)
            args = tuple(args)

        if kwargs and self.params:
            # Adapt all adaptable arguments
            for key, val in kwargs.items():
                try:
                    kwargs[key] = self._adapt_param(key, val)
                except AnticipateParamError as e:
                    errors.append(e)

        if errors:
            raise AnticipateErrors(
                message='Invalid input for %s' % self.func,
                errors=errors)

        return args, kwargs
86775
def add_arguments(self):
        
        if self.parser is None:
            raise TypeError("Parser cannot be None, has create_parser been called?")

        for keys, kwargs in self.args.items():
            if not isinstance(keys, tuple):
                keys = (keys,)
            self.parser.add_argument(*keys, **kwargs)
85514
def args(**kwargs):
    

    kwargs_str = ",".join(["%s=%r" % (k,v) for k,v in kwargs.items()])

    raise DeprecationWarning("""

sh.args() has been deprecated because it was never thread safe.  use the
following instead:

    sh2 = sh({kwargs})
    sh2.your_command()

or

    sh2 = sh({kwargs})
    from sh2 import your_command
    your_command()

""".format(kwargs=kwargs_str))
887355
def with_args_validator(self, matching_function):
        
        self.args = None
        self.kwargs = None
        self._custom_matcher = matching_function
        return self
299871
def get_args(self, kwargs):
        """"""
        args = dict(self.LoggerArgs)
        args.update(kwargs)
        return args
518110
def joinArgs(args):
    
    if not args:
        return ''
    arglist = []
    for key in sorted(args, key=lambda x: x.lower()):
        value = compat.ustr(args[key])
        arglist.append('%s=%s' % (key, compat.quote(value)))
    return '?%s' % '&'.join(arglist)
967837
def remap_args(input_args, remap):
    
    out_args = input_args
    for dest_key, src_keys in remap.items():
        remap_value = None
        if isinstance(src_keys, str):
            src_keys = [src_keys]

        for key in src_keys:
            if key in input_args:
                remap_value = input_args[key]
                break

        if remap_value is not None:
            if out_args is input_args:
                out_args = {**input_args}
            out_args[dest_key] = remap_value

    return out_args
376377
def _get_args(self, kwargs):
        '''
        
        '''
        _args = list()
        _kwargs = salt.utils.args.clean_kwargs(**kwargs)

        return _args, _kwargs
23327
def p_arguments(p):
    
    if p[1] is None or p[3] is None:
        p[0] = None
    else:
        p[0] = make_arg_list(p[1], make_argument(p[3], p.lineno(2)))
709990
def p_args(self, p):
        """"""
        if len(p) > 3:
            if p[3] == ',':
                p[0] = (p[2], p[4])
            elif isinstance(p[2], dict):
                p[0] = ([], p[2])
            else:
                p[0] = (p[2], {})
        else:
            p[0] = ([], {})