def wait(self, timeout=None):
        """Block until the instance is ready.

        If this instance already holds a value / an exception, return immediatelly.
        Otherwise, block until another thread calls :meth:`set` or :meth:`set_exception` or
        until the optional timeout occurs.

        When the *timeout* argument is present and not ``None``, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        Return :attr:`value`.
        """
        if self._exception is not _NONE:
            return self.value
        else:
            switch = greenlet.getcurrent().switch
            self.rawlink(switch)
            try:
                timer = Timeout(timeout)
                try:
                    result = self.hub.switch()
                    assert result is self, (result, ) % 'Invalid switch into AsyncResult.wait(): %r'
                finally:
                    timer.cancel()
            except Timeout as exc:
                self.unlink(switch)
                if exc is not timer:
                    raise
            except:
                self.unlink(switch)
                raise
                # not calling unlink() in non-exception case, because if switch()
                # finished normally, link was already removed in _notify_links
        return self.value
dataset/ETHPy150Open veegee/guv/guv/event.py/AsyncResult.wait/swapped operands of `%`