def _throw_exception(exception: Exception):
    """Returns a function pointer for a function throwing an arbitrary
    exception"""

    def _throw(*args, **kwargs):
        raise exception
    return _throw