def wait_for(text, finish=None, io=None):
if finish:<EOL><INDENT>finish.set()<EOL>time.sleep(<NUM_LIT:0.1>) <EOL><DEDENT>if not io:<EOL><INDENT>io = sys.stdout<EOL><DEDENT>finish = threading.Event()<EOL>io.write(text)<EOL>def _wait():<EOL><INDENT>while not finish.is_set():<EOL><INDENT>io.write('<STR_LIT:.>')<EOL>io.flush()<EOL>finish.wait(timeout=<NUM_LIT:1>)<EOL><DEDENT>io.write('<STR_LIT:\n>')<EOL><DEDENT>threading.Thread(target=_wait).start()<EOL>return finish<EOL>
Displays dots until returned event is set