<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_exception(exception):
 """Encode exception to a form that can be passed around and serialized. This will grab the stack, then strip off the last two calls which are encode_exception and the function that called it. """

    import sys
    return AsyncException(unicode(exception),
                          exception.args,
                          sys.exc_info(),
                          exception)