@fasteners.locked
    def transition(self, new_state):
        """Transitions the request to a new state.

        If transition was performed, it returns True. If transition
        was ignored, it returns False. If transition was not
        valid (and will not be performed), it raises an InvalidState
        exception.
        """
        old_state = self._machine.current_state
        if old_state == new_state:
            return False
        try:
            self._machine.process_event(make_an_event(new_state))
        except (machine_excp.NotFound, machine_excp.InvalidState) as e:
            raise excp.InvalidState("Request transition from %s to %s is"
                                    " not allowed: %s" % (old_state,
                                                          new_state, e))
        else:
            if STOP_TIMER_STATES in new_state:
                self._watch.stop()
            LOG.debug("Transitioned '%s' from %s state to %s state", self,
                      old_state, new_state)
            return True
dataset/ETHPy150Open openstack/taskflow/taskflow/engines/worker_based/protocol.py/Request.transition/swapped operands of `in`