code: def transition(self, from_, to, if_=None, **data):
          
          def decorator(f):
              if isinstance(f, StateTransition):
                  f.add_transition(self, from_, to, if_, data)
                  st = f
              else:
                  st = StateTransition(f, self, from_, to, if_, data)
              self.transitions.append(st.name)
              return st
  
          return decorator
docs: Decorates a method to transition from one state to another. The
          decorated method can accept any necessary parameters and perform
          additional processing, or raise an exception to abort the transition.
          If it returns without an error, the state value is updated
          automatically. Transitions may also abort without raising an exception
          using :exc:`AbortTransition`.
  
          :param from_: Required state to allow this transition (can be a state group)
          :param to: The state of the object after this transition (automatically set if no exception is raised)
          :param if_: Validator(s) that, given the object, must all return True for the transition to proceed
          :param data: Additional metadata, stored on the `StateTransition` object as a :attr:`data` attribute