import inspect


def _check_exec(func):
    """
    Check the signature of the func to see if it is a proper
    execute function: must accept one (or more optional) args
    and can accept kwargs. This returns true of kwargs are accepted

    Args:
      func: the function to check

    Returns:
      true if the function accepts kwargs

    """
    argspec = inspect.getfullargspec(func)
    if (
        len(argspec.args) == 1
        or len(argspec.args) == 2
        and argspec.args[0] == "self"
        or argspec.varargs is not None
    ):
        pass
    else:
        raise Exception(
            "Processing resource execution function does not accept exactly one or any number of arguments"
        )
    if argspec.varkw is not None:
        return True
    else:
        return False