<s> """<STR_LIT>""" <EOL> from google . protobuf import descriptor_pool <EOL> class SymbolDatabase ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _symbols = { } <EOL> self . _symbols_by_file = { } <EOL> self . pool = descriptor_pool . DescriptorPool ( ) <EOL> def RegisterMessage ( self , message ) : <EOL> """<STR_LIT>""" <EOL> desc = message . DESCRIPTOR <EOL> self . _symbols [ desc . full_name ] = message <EOL> if desc . file . name not in self . _symbols_by_file : <EOL> self . _symbols_by_file [ desc . file . name ] = { } <EOL> self . _symbols_by_file [ desc . file . name ] [ desc . full_name ] = message <EOL> self . pool . AddDescriptor ( desc ) <EOL> return message <EOL> def RegisterEnumDescriptor ( self , enum_descriptor ) : <EOL> """<STR_LIT>""" <EOL> self . pool . AddEnumDescriptor ( enum_descriptor ) <EOL> return enum_descriptor <EOL> def RegisterFileDescriptor ( self , file_descriptor ) : <EOL> """<STR_LIT>""" <EOL> self . pool . AddFileDescriptor ( file_descriptor ) <EOL> def GetSymbol ( self , symbol ) : <EOL> """<STR_LIT>""" <EOL> return self . _symbols [ symbol ] <EOL> def GetPrototype ( self , descriptor ) : <EOL> """<STR_LIT>""" <EOL> return self . GetSymbol ( descriptor . full_name ) <EOL> def GetMessages ( self , files ) : <EOL> """<STR_LIT>""" <EOL> result = { } <EOL> for f in files : <EOL> result . update ( self . _symbols_by_file [ f ] ) <EOL> return result <EOL> _DEFAULT = SymbolDatabase ( ) <EOL> def Default ( ) : <EOL> """<STR_LIT>""" <EOL> return _DEFAULT </s>
