def wait_until(predicate, timeout=<NUM_LIT:30>):
not_expired = Timeout(timeout)<EOL>while not_expired():<EOL><INDENT>r = predicate()<EOL>if r:<EOL><INDENT>break<EOL><DEDENT><DEDENT>
Wait until predicate returns a truthy value or the timeout is reached.

    >>> wait_until(lambda: True, timeout=10)