human
Complete the below
def exception_when_false_wrapper(func, exception_class, value_error_message_template):

    ''''Wrap a function to raise an exception when the return value is not True.
    :param func: function to wrap
    :type func: function
    :param exception_class: exception class to raise
    :type exception_class: Exception
    :param value_error_message_template: string to pass to exception
    :type value_error_message_template: str
    :return: wrapped function
    :rtype: function
    :raise exception_class: when func returns not true'
    '''

=====
Write me a the Python code you requested?
assistant
#Here is the Python code you requested.
    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