<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _set_state(self, new_state, response=None):
 """ Set the state of the tracker. :param new_state: The new state of the tracker. :type new_state: :class:`~.MessageState` member :param response: A stanza related to the new state. :type response: :class:`~.StanzaBase` or :data:`None` :raise ValueError: if a forbidden state transition is attempted. :raise RuntimeError: if the tracker is closed. The state of the tracker is set to the `new_state`. The :attr:`response` is also overriden with the new value, no matter if the new or old value is :data:`None` or not. The :meth:`on_state_changed` event is emitted. The following transitions are forbidden and attempting to perform them will raise :class:`ValueError`: * any state -> :attr:`~.MessageState.IN_TRANSIT` * :attr:`~.MessageState.DELIVERED_TO_RECIPIENT` -> :attr:`~.MessageState.DELIVERED_TO_SERVER` * :attr:`~.MessageState.SEEN_BY_RECIPIENT` -> :attr:`~.MessageState.DELIVERED_TO_RECIPIENT` * :attr:`~.MessageState.SEEN_BY_RECIPIENT` -> :attr:`~.MessageState.DELIVERED_TO_SERVER` * :attr:`~.MessageState.ABORTED` -> any state * :attr:`~.MessageState.ERROR` -> any state If the tracker is already :meth:`close`\\ -d, :class:`RuntimeError` is raised. This check happens *before* a test is made whether the transition is valid. This method is part of the "protected" interface. """

        if self._closed:
            raise RuntimeError("message tracker is closed")

        # reject some transitions as documented
        if (self._state == MessageState.ABORTED or
                new_state == MessageState.IN_TRANSIT or
                (self._state == MessageState.ERROR and
                 new_state == MessageState.DELIVERED_TO_SERVER) or
                (self._state == MessageState.ERROR and
                 new_state == MessageState.ABORTED) or
                (self._state == MessageState.DELIVERED_TO_RECIPIENT and
                 new_state == MessageState.DELIVERED_TO_SERVER) or
                (self._state == MessageState.SEEN_BY_RECIPIENT and
                 new_state == MessageState.DELIVERED_TO_SERVER) or
                (self._state == MessageState.SEEN_BY_RECIPIENT and
                 new_state == MessageState.DELIVERED_TO_RECIPIENT)):
            raise ValueError(
                "message tracker transition from {} to {} not allowed".format(
                    self._state,
                    new_state
                )
            )

        self._state = new_state
        self._response = response
        self.on_state_changed(self._state, self._response)