@contextlib.contextmanager
    def event_loop_until_traits_change(self, traits_object, *traits, **kw):
        timeout = kw.pop('timeout', 10.0)
        condition = threading.Event()

        traits = set(traits)
        recorded_changes = set()

        def set_event(trait):
            recorded_changes.add(trait)
            if recorded_changes == traits:
                condition.set()

        handlers = {}
        for trait in traits:
            handlers[trait] = lambda: set_event(trait)

        for trait, handler in handlers.iteritems():
            traits_object.on_trait_change(handler, trait)
        try:
            with self.event_loop_until_condition(
                    condition=condition.is_set, timeout=timeout):
                yield
        finally:
            for trait, handler in handlers.iteritems():
                traits_object.on_trait_change(handler, trait, remove=True)
Starting with self.over climb over links resolving the links as needed along the way
dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/util/gui_test_assistant.py/GuiTestAssistant.event_loop_until_traits_change--crossover with--dataset/ETHPy150Open ioflo/ioflo/ioflo/base/framing.py/Frame.resolveOverLinks