def is_valid_args(func, args, kwargs, sigspec=None):
        if sigspec is None:
            try:
                sigspec = inspect.signature(func)
            except (__HOLE__, TypeError) as e:
                sigspec = e
        if isinstance(sigspec, ValueError):
            return _is_builtin_valid_args(func, args, kwargs)
        elif isinstance(sigspec, TypeError):
            return False
        try:
            sigspec.bind(*args, **kwargs)
        except (TypeError, AttributeError):
            return False
        return True
dataset/ETHPy150Open pytoolz/toolz/toolz/functoolz.py/is_valid_args