(self, *args, **kwargs)
Remove event handlers from the event stack.

        See `push_handlers` for the accepted argument types.  All handlers
        are removed from the first stack frame that contains any of the given
        handlers.  No error is raised if any handler does not appear in that
        frame, or if no stack frame contains any of the given handlers.

        If the stack frame is empty after removing the handlers, it is 
        removed from the stack.  Note that this interferes with the expected
        symmetry of `push_handlers` and `pop_handlers`.
Remove event handlers from the event stack.
Remove event handlers from the event stack .
def remove_handlers(self, *args, **kwargs):
        '''Remove event handlers from the event stack.

        See `push_handlers` for the accepted argument types.  All handlers
        are removed from the first stack frame that contains any of the given
        handlers.  No error is raised if any handler does not appear in that
        frame, or if no stack frame contains any of the given handlers.

        If the stack frame is empty after removing the handlers, it is 
        removed from the stack.  Note that this interferes with the expected
        symmetry of `push_handlers` and `pop_handlers`.
        '''
        handlers = list(self._get_handlers(args, kwargs))

        # Find the first stack frame containing any of the handlers
        def find_frame():
            for frame in self._event_stack:
                for name, handler in handlers:
                    try:
                        if frame[name] == handler:
                            return frame
                    except KeyError:
                        pass
        frame = find_frame()

        # No frame matched; no error.
        if not frame:
            return

        # Remove each handler from the frame.
        for name, handler in handlers:
            try:
                if frame[name] == handler:
                    del frame[name]
            except KeyError:
                pass

        # Remove the frame if it's empty.
        if not frame:
            self._event_stack.remove(frame)
def remove_handlers ( self , * args , * * kwargs ) : handlers = list ( self . _get_handlers ( args , kwargs ) ) # Find the first stack frame containing any of the handlers def find_frame ( ) : for frame in self . _event_stack : for name , handler in handlers : try : if frame [ name ] == handler : return frame except KeyError : pass frame = find_frame ( ) # No frame matched; no error. if not frame : return # Remove each handler from the frame. for name , handler in handlers : try : if frame [ name ] == handler : del frame [ name ] except KeyError : pass # Remove the frame if it's empty. if not frame : self . _event_stack . remove ( frame )