def check_transitions(self):
        ''' Returns the first State thats condition evaluates true (condition order is randomized) '''
        if hasattr(self, "transitions"):
            shuffle(self.transitions)
            for transition in self.transitions:
                condition, state = transition
                if condition():
                    return state
 Returns the first State thats condition evaluates true (condition order is randomized) 
recipes/Python/578656_State_Machine_Framework_AI/recipe-578656.py