def is_state(self, switch_name, state, ms=0):
        """Queries whether a switch is in a given state and (optionally)
        whether it has been in that state for the specified number of ms.

        Returns True if the switch_name has been in the state for the given
        number of ms. If ms is not specified, returns True if the switch
        is in the state regardless of how long it's been in that state.

        """

        if self.switches[switch_name]['state'] == state:
            if ms <= self.ms_since_change(switch_name):
                return True
            else:
                return False
        else:
            return False
dataset/ETHPy150Open missionpinball/mpf/mpf/system/switch_controller.py/SwitchController.is_state/original