def remove_switch_handler(self, switch_name, callback, state=1, ms=0):
        """Removes a registered switch handler.

        Currently this only works if you specify everything exactly as you set
        it up. (Except for return_info, which doesn't matter if true or false, it
        will remove either / both.

        """

        self.log.debug(
            "Removing switch handler. Switch: %s, State: %s, ms: %s",
            switch_name, state, ms)

        entry_key = str(switch_name) + '-' + str(state)

        if self.registered_switches in entry_key:
            for index, settings in enumerate(
                    self.registered_switches[entry_key]):
                if (settings['ms'] == ms and
                            settings['callback'] == callback):
                    self.registered_switches[entry_key].remove(settings)

        for timed_key, timed_entry in self.active_timed_switches.items():
            for key, entry in enumerate(timed_entry):
                if entry['switch_action'] == entry_key and entry['ms'] == ms and entry['callback'] == callback:
                    entry['removed'] = True
dataset/ETHPy150Open missionpinball/mpf/mpf/system/switch_controller.py/SwitchController.remove_switch_handler/swapped operands of `in`