code: def wait(self):
          
          d = defer.Deferred()
          if self._result is None:
              self._waiters.append(d)
          else:
              self._fire_deferred(d)
          return d
docs: Return a deferred that will be fired when the event is fired.