def handle_message(self, message):
        from scsgate.messages import StateMessage, ScenarioTriggeredMessage

        self._logger.debug("Received message {}".format(message))
        if not isinstance(message, StateMessage) and \
           not isinstance(message, ScenarioTriggeredMessage):
            msg = "Ignored message {} - not releavant type".format(
                message)
            self._logger.debug(msg)
            return

        if message.entity in self._devices:
            new_device_activated = False
            with self._devices_to_register_lock:
                if message.entity == self._device_being_registered:
                    self._device_being_registered = None
                    new_device_activated = True
            if new_device_activated:
                self._activate_next_device()

            # pylint: disable=broad-except
            try:
                self._devices[message.entity].process_event(message)
            except Exception as exception:
                msg = "Exception while processing event: {}".format(
                    exception)
                self._logger.error(msg)
        else:
            self._logger.info(
                "Ignoring state message for device {} because unknonw".format(
                    message.entity))
Add a multi-word expression to the lexicon (stored as a word trie)
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/scsgate.py/SCSGate.handle_message--crossover with--dataset/ETHPy150Open nltk/nltk/nltk/tokenize/mwe.py/MWETokenizer.add_mwe