def emit(self, event, data):
        to_remove = []
        for handler in reversed(self.handlers[event]):
            if handler(event, data):
                to_remove.append(handler)
            else:
                raise AssertionError('%s %s' % (handler.__name__, handler))

        for handler in to_remove:
            self.handlers[event].remove(handler)
dataset/ETHPy150Open SpockBotMC/SpockBot/tests/plugins/core/test_taskmanager.py/EventMock.emit/original