human
I wrote the below code

    def g(target, *args, **kwargs):
        val = func(target, *args, **kwargs)
        if val:
            return val
        else:
            raise exception_class((value_error_message_template % target))
    g.__name__ = func.__name__
    g.__doc__ = func.__doc__
    return g

What's a good function header?
assistant
#Here's a good function header.

def exception_when_false_wrapper(func, exception_class, value_error_message_template):