<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def NOT(fn):
 """ Reverse the effect of a chainable validator function """

    @chainable
    def validator(v):
        try:
            fn(v)
        except ValueError:
            return v
        raise ValueError('invalid')
    return validator