def check_all_params_are_keyword(method):
    """
    Raises CooperativeError if method any parameter that is not a
    named keyword parameter
    """

    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"
dataset/ETHPy150Open arximboldi/cooper/cooper/cooper.py/check_all_params_are_keyword/original