def get_transition (self, input_symbol, state, default = None):
            
            has_memory = self.memory.get(state, None)
            # TODO: Change to fsm to work without empty state 
            while (((self.empty_transition, state) in self.state_transitions) and
                    (state not in self.memory or not has_memory)):
                    (self.current_context, self.action, self.current_state) = self.state_transitions[(self.EMPTY_TRANSITION, state)]
            
            
                    state = self.current_state
            if ((input_symbol is not self.EMPTY_TRANSITION) and has_memory):
                return self.get_transition_from_memory(input_symbol, state)
            if self.state_transitions.has_key((input_symbol, state)):
                return self.state_transitions[(input_symbol, state)]
            elif self.state_transitions_any.has_key (state):
                return self.state_transitions_any[state]
            elif self.default_transition is not None:
                return self.default_transition
            elif (default is not None): 
                return default
            else:
                raise ExceptionFSM ('Transition is undefined: (%s, %s).' %
                                    (str(input_symbol), str(state)) )
This returns (action, next state) given an input_symbol and state.
dataset/ETHPy150Open ooici/pyon/pyon/core/governance/conversation/core/fsm.py/FSM.get_transition