#NEWLINE# def set_state( self , new_state_name ) : #NEWLINE# #INDENT# if ( self . active_state is not None ) : #NEWLINE# #INDENT# self . active_state . exit_actions ( ) #NEWLINE# #UNINDENT# self . active_state = new_state_name . states [ new_state_name ] #NEWLINE# self . active_state . entry_actions ( )