code: def transition_allowed(self, initial_state, target_state):
          # type: (str, str) -> bool
          
          assert initial_state in self._allowed, \
              "%s is not in %s" % (initial_state, list(self._allowed))
          return target_state in self._allowed[initial_state]
docs: Check if a transition between two states is allowed