def is_partial_args(func, args, kwargs, sigspec=None):
        if sigspec is None:
            try:
                sigspec = inspect.getargspec(func)
            except __HOLE__ as e:
                sigspec = e
        if isinstance(sigspec, TypeError):
            if not callable(func):
                return False
            return _is_builtin_partial_args(func, args, kwargs)

        spec = sigspec
        defaults = spec.defaults or ()
        num_pos = len(spec.args) - len(defaults)
        if spec.varargs is None:
            num_extra_pos = max(0, len(args) - num_pos)
        else:
            num_extra_pos = 0

        kwargs = dict(kwargs)

        # Add missing keyword arguments (unless already included in `args`)
        missing_kwargs = spec.args[num_pos + num_extra_pos:]
        kwargs.update(zip(missing_kwargs, defaults[num_extra_pos:]))

        # Add missing position arguments as keywords (may already be in kwargs)
        missing_args = spec.args[len(args):num_pos + num_extra_pos]
        kwargs.update((x, None) for x in missing_args)

        # Convert call to use positional arguments
        args = args + tuple(kwargs.pop(key) for key in spec.args[len(args):])

        if (
            not spec.keywords and kwargs or
            not spec.varargs and len(args) > len(spec.args) or
            set(spec.args[:len(args)]) & set(kwargs)
        ):
            return False
        else:
            return True
dataset/ETHPy150Open pytoolz/toolz/toolz/functoolz.py/is_partial_args