<s> class OracleManager ( self ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> self . _oracle_map = dict ( ) <EOL> self . _listeners = list ( ) <EOL> self . _id = <NUM_LIT:0> <EOL> def register_oracle ( self , data ) : <EOL> self . _id = self . _id + <NUM_LIT:1> <EOL> key = self . _id <EOL> self . oracle_map [ key ] = data <EOL> return key <EOL> def data_from_oracle_map ( self , data_id ) : <EOL> return self . _oracle_map . get ( data_id ) <EOL> def clear_data_oracle_map ( self , data_id ) : <EOL> try : <EOL> del self . _oracle_map [ data_id ] <EOL> except KeyError as e : <EOL> self . Core . write_event ( e . parameter + "<STR_LIT:\n>" , '<STR_LIT:a>' ) <EOL> def reset ( self ) : <EOL> self . _oracle_map = dict ( ) <EOL> self . _id = <NUM_LIT:0> <EOL> def add_oracle_listener ( self , listener ) : <EOL> self . _listeners . append ( listener ) <EOL> def remove_oracle_listener ( self , listener ) : <EOL> try : <EOL> self . _listeners . remove ( listener ) <EOL> except ValueError as e : <EOL> self . Core . write_event ( e . parameter + "<STR_LIT:\n>" , '<STR_LIT:a>' ) <EOL> def oracle_invoked ( self , oracle_id ) : <EOL> for listener in self . _listeners : <EOL> listener . oracle_invoked ( oracle_id ) </s>
