<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_exception(self, exception):
 """Set the Future's exception."""

        self._exception = exception
        self._result_set = True
        self._invoke_callbacks(self)