#NEWLINE# @ contextlib . contextmanager #NEWLINE# def event_loop_with_timeout( self , repeat = 2 , timeout = 10.0 ) : #NEWLINE# #INDENT# 'Helper context manager to send all posted events to the event queue\n        and wait for them to be processed.\n\n        This differs from the `event_loop()` context manager in that it\n        starts the real event loop rather than emulating it with\n        `QApplication.processEvents()`\n\n        Parameters\n        ----------\n        repeat : int\n            Number of times to process events. Default is 2.\n        timeout : float, optional, keyword only\n            Number of seconds to run the event loop in the case that the trait\n            change does not occur. Default value is 10.0.\n        ' #NEWLINE# ( yield ) #NEWLINE# self . event_loop_helper . event_loop_with_timeout ( repeat = repeat , timeout = timeout )