code: def wait(self, timeout=None):
          
          self.ev_done.wait(timeout=timeout)
  
          if not self.ev_done.is_set():
              raise TaskTimeout("Task %s timed out." % self)
  
          # --> self.result is set
          # If it is an exception, then raise it in this waiter
          if isinstance(self.result, Exception):
              raise self.result
  
          # Release waiters and perform callbacks
          # done() has already been called, because of self.ev_done check
          # "asynchronous" tasks should could call done() here
          #self.done(self.result)
  
          return self.result
docs: This method waits for an executing task to finish.
          Subclass can override this method if necessary.