def _popEventHandlers(ctrl):
    
    # Assume that all traitsui event handlers are on the top of the stack
    while ctrl is not ctrl.GetEventHandler():
        handler = ctrl.GetEventHandler()
        if isinstance(handler, EventHandlerWrapper):
            ctrl.PopEventHandler(True)
        else:
            break
    for child in ctrl.GetChildren():
        _popEventHandlers(child)
Pack image from file into multipart-formdata post body
dataset/ETHPy150Open enthought/traitsui/traitsui/wx/toolkit.py/_popEventHandlers--crossover with--dataset/ETHPy150Open tweepy/tweepy/tweepy/api.py/API._pack_image