def wait(self, timeout=None):
        """Must be used with 'yield' as 'yield event.wait()' .
        """
        if self._flag:
            raise StopIteration(True)
        coro = AsynCoro.cur_coro()
        if timeout is not None:
            if timeout <= 0:
                raise StopIteration(False)
        self._waitlist.append(coro)
        if (yield coro._await_(timeout)) is None:
            try:
                self._waitlist.remove(coro)
            except ValueError:
                pass
            raise StopIteration(False)
        else:
            raise StopIteration(True)
dataset/ETHPy150Open pgiri/asyncoro/py2/asyncoro/__init__.py/Event.wait/original