<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wrap_exception(exception, cause):
 """ Wraps another exception into specified application exception object. If original exception is of ApplicationException type it is returned without changes. Otherwise the original error is set as a cause to specified ApplicationException object. :param exception: an ApplicationException object to wrap the cause :param cause: an original error object :return: an original or newly created ApplicationException """

        if isinstance(cause, ApplicationException):
            return cause
        
        exception.with_cause(cause)
        return exception