def is_invalid_params(func, *args, **kwargs):
<EOL>if not inspect.isfunction(func):<EOL><INDENT>return True<EOL><DEDENT>funcargs, varargs, varkwargs, defaults = inspect.getargspec(func)<EOL>if defaults:<EOL><INDENT>funcargs = funcargs[:-len(defaults)]<EOL><DEDENT>if args and len(args) != len(funcargs):<EOL><INDENT>return True<EOL><DEDENT>if kwargs and set(kwargs.keys()) != set(funcargs):<EOL><INDENT>return True<EOL><DEDENT>if not args and not kwargs and funcargs:<EOL><INDENT>return True<EOL><DEDENT>return False<EOL>
Check, whether function 'func' accepts parameters 'args', 'kwargs'.

    NOTE: Method is called after funct(*args, **kwargs) generated TypeError,
    it is aimed to destinguish TypeError because of invalid parameters from
    TypeError from inside the function.

    .. versionadded: 1.9.0