def sleep(self, seconds=<NUM_LIT>, dt=<NUM_LIT>):
t0 = _t.time()<EOL>while _t.time()-t0 < seconds:<EOL><INDENT>_t.sleep(dt)<EOL>self.process_events()<EOL><DEDENT>
A "smooth" version of time.sleep(): waits for the time to pass but
processes events every dt as well.

Note this requires that the object is either a window or embedded 
somewhere within a window.