def wait(self, timeout=None):
try:<EOL><INDENT>if timeout:<EOL><INDENT>gevent.sleep(timeout)<EOL><DEDENT>else:<EOL><INDENT>while True:<EOL><INDENT>gevent.sleep(<NUM_LIT:1000>)<EOL><DEDENT><DEDENT><DEDENT>except (KeyboardInterrupt, SystemExit, Exception):<EOL><INDENT>pass<EOL><DEDENT>
Wait for events.