code: def _assert_transition(self, event):
          
          state = self.domain.state()[0]
          if event not in STATES_MAP[state]:
              raise RuntimeError("State transition %s not allowed" % event)
docs: Asserts the state transition validity.