<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def result(self, timeout=None):
 """Return the last result of the callback chain or raise the last exception thrown and not caught by an errback. This will block until the result is available. If a timeout is given and the call times out raise a TimeoutError If SIGINT is caught while waiting raises CancelledError. If cancelled while waiting raises CancelledError This acts much like a pythonfutures.Future.result() call except the entire callback processing chain is performed first. """


        self._do_wait(timeout)

        if self._exception:
            self._last_exception.exception = None
            self._last_exception.tb_info = None
            raise self._result
        else:
            return self._result