Determining whether args/kwargs are the ONLY matched args/kwargs called previously
        Handle each arg/kwarg as a SinonMatcher
        Return: Boolean
762658
def alwaysCalledWithMatch(self, *args, **kwargs): #pylint: disable=invalid-name
        
        self.__remove_args_first_item()
        alist, klist, gfunc = self.args, self.kwargs, self.__get_func
        if args and kwargs:
            return (uch.tuple_partial_cmp_always(args, alist, gfunc) and
                    uch.dict_partial_cmp_always(kwargs, klist, gfunc))
        elif args:
            return uch.tuple_partial_cmp_always(args, alist, gfunc)
        elif kwargs:
            return uch.dict_partial_cmp_always(kwargs, klist, gfunc)
        else:
            ErrorHandler.called_with_empty_error()
        self.__get_func = SinonSpy.__get_by_matcher
701690
def _check_arguments(self):
        """"""
        if self.argument_checked:
            return

        assert(self.symbol is not None)
        self.argument_checked = True

        # check if symbol contain duplicated names.
        _check_arguments(self.symbol)
        # rematch parameters to delete useless ones
        if self.allow_extra_params:
            if self.arg_params:
                arg_names = set(self.symbol.list_arguments())
                self.arg_params = {k : v for k, v in self.arg_params.items()
                                   if k in arg_names}
            if self.aux_params:
                aux_names = set(self.symbol.list_auxiliary_states())
                self.aux_params = {k : v for k, v in self.aux_params.items()
                                   if k in aux_names}
689528
def check_oneof(**kwargs):
    
    # Sanity check: If no keyword arguments were sent, this is fine.
    if not kwargs:
        return None

    not_nones = [val for val in kwargs.values() if val is not None]
    if len(not_nones) > 1:
        raise ValueError('Only one of {fields} should be set.'.format(
            fields=', '.join(sorted(kwargs.keys())),
        ))
1295835
def find_callback(args, kw=None):
    ''
    if args and callable(args[-1]):
        return args[-1], args[:-1]
    try:
        return kw['callback'], args
    except (KeyError, TypeError):
        return None, args
1106745
private static boolean isCompatible(ArgumentMatcher<?> argumentMatcher, Object argument) {
        if (argument == null)
            return true;

        Class<?> expectedArgumentType = getArgumentType(argumentMatcher);

        return expectedArgumentType.isInstance(argument);
    }
246918
def request_args(self):
        '''
        
        '''
        kwargs = {}
        kwargs.update(self.request.match_info.items())
        kwargs.update(self.request.query.items())
        return kwargs
1279474
def _check_args(*argl, **argd):
    
    args = {"_": []}
    for item in argl:
        args["_"].append(_tracker_str(item))
           
    for key, item in argd.items():
        args[key] = _tracker_str(item)
        
    return args
683842
def _validate_func_args(func, kwargs):
    """"""

    args, varargs, varkw, defaults = inspect.getargspec(func)
    if set(kwargs.keys()) != set(args[1:]): # chop off self
        raise TypeError("decorator kwargs do not match %s()'s kwargs"
                        % func.__name__)
390969
def exists(self, pattern, **match_kwargs):
        
        ret = self.match(pattern, **match_kwargs)
        if ret is None:
            return None
        if not ret.matched:
            return None
        return ret
1242899
def kwargs(self):
        
        keywords = self.keywords or []
        return [keyword for keyword in keywords if keyword.arg is None]
40991
def check_all_params_are_keyword(method):
    

    args, varargs, keywords, defaults = inspect.getargspec(method)

    # Always have self, thus the -1
    if len(args or []) - 1 != len(defaults or []):
        raise CooperativeError, "Init has positional parameters " + \
              str(args[1:])
    if varargs:
        raise CooperativeError, "Init has variadic positional parameters"
    if keywords:
        raise CooperativeError, "Init has variadic keyword parameters"
774468
def _resolve_args(self, env, args):
        
        pos_args, kw_args = args

        def check_value(v):
            if isinstance(v, AstTypeRef):
                return self._resolve_type(env, v)
            else:
                return v

        new_pos_args = [check_value(pos_arg) for pos_arg in pos_args]
        new_kw_args = {k: check_value(v) for k, v in kw_args.items()}
        return new_pos_args, new_kw_args
571565
private boolean isKwarg(Map<String, Object> arg) {
        Object kwarg = arg.get(KWARG_KEY);
        return kwarg != null
                && kwarg instanceof Boolean
                && ((Boolean) kwarg);
    }
33709
def satisfy_exact_match(self, args, kwargs):
        

        if self.args is None and self.kwargs is None:
            return False
        elif self.args is _any and self.kwargs is _any:
            return True
        elif args == self.args and kwargs == self.kwargs:
            return True
        elif len(args) != len(self.args) or len(kwargs) != len(self.kwargs):
            return False

        if not all(x == y or y == x for x, y in zip(args, self.args)):
            return False

        for key, value in self.kwargs.items():
            if key not in kwargs:
                return False
            elif not (kwargs[key] == value or value == kwargs[key]):
                return False

        return True
160898
def has_been_called_with?(*args)
      raise NeverHookedError unless @was_hooked
      match = block_given? ? Proc.new : proc { |call| call.args == args }
      calls.any?(&match)
    end
887355
def with_args_validator(self, matching_function):
        
        self.args = None
        self.kwargs = None
        self._custom_matcher = matching_function
        return self
775716
def satisfy_custom_matcher(self, args, kwargs):
        
        if not self._custom_matcher:
            return False
        try:
            return self._custom_matcher(*args, **kwargs)
        except Exception:
            return False