<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def post(cond):
 """ Add a postcondition check to the annotated method. The condition is passed the return value of the annotated method. """

    source = inspect.getsource(cond).strip()

    def inner(f):
        if enabled:
            # deal with the real function, not a wrapper
            f = getattr(f, 'wrapped_fn', f)

            def check_condition(result):
                if not cond(result):
                    raise AssertionError('Postcondition failure, %s' % source)

            # append to the rest of the postconditions attached to this method
            if not hasattr(f, 'postconditions'):
                f.postconditions = []
            f.postconditions.append(check_condition)

            return check(f)
        else:
            return f

    return inner