#NEWLINE# def FindFileContainingSymbol( self , symbol ) : #NEWLINE# #INDENT# 'Gets the FileDescriptor for the file containing the specified symbol.\n\n    Args:\n      symbol: The name of the symbol to search for.\n\n    Returns:\n      A FileDescriptor that contains the specified symbol.\n\n    Raises:\n      KeyError: if the file can not be found in the pool.\n    ' #NEWLINE# symbol = _NormalizeFullyQualifiedName ( symbol ) #NEWLINE# try : #NEWLINE# #INDENT# return self . _descriptors [ symbol ] . file #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# return self . _enum_descriptors [ symbol ] . file #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# file_proto = self . _internal_db . FindFileContainingSymbol ( symbol ) #NEWLINE# #UNINDENT# except KeyError as error : #NEWLINE# #INDENT# if symbol . _descriptor_db : #NEWLINE# #INDENT# file_proto = self . _descriptor_db . FindFileContainingSymbol ( symbol ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise error #NEWLINE# #UNINDENT# #UNINDENT# if ( not file_proto ) : #NEWLINE# #INDENT# raise KeyError ( ( 'Cannot find a file containing %s' % symbol ) ) #NEWLINE# #UNINDENT# return self . _ConvertFileProtoToFileDescriptor ( file_proto )