#NEWLINE# def AddDescriptor( self , desc ) : #NEWLINE# #INDENT# 'Adds a Descriptor to the pool, non-recursively.\n\n    If the Descriptor contains nested messages or enums, the caller must\n    explicitly register them. This method also registers the FileDescriptor\n    associated with the message.\n\n    Args:\n      desc: A Descriptor.\n    ' #NEWLINE# if ( not isinstance ( desc , descriptor . Descriptor ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Expected instance of descriptor.Descriptor.' ) #NEWLINE# #UNINDENT# self . _descriptors [ desc . full_name ] = desc #NEWLINE# self . AddFileDescriptor ( desc . file )