def FindFileByName(self, file_name):
try:<EOL><INDENT>return self._file_descriptors[file_name]<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>file_proto = self._internal_db.FindFileByName(file_name)<EOL><DEDENT>except KeyError as error:<EOL><INDENT>if self._descriptor_db:<EOL><INDENT>file_proto = self._descriptor_db.FindFileByName(file_name)<EOL><DEDENT>else:<EOL><INDENT>raise error<EOL><DEDENT><DEDENT>if not file_proto:<EOL><INDENT>raise KeyError('<STR_LIT>' % file_name)<EOL><DEDENT>return self._ConvertFileProtoToFileDescriptor(file_proto)<EOL>
Gets a FileDescriptor by file name.

        Args:
          file_name: The path to the file to get a descriptor for.

        Returns:
          A FileDescriptor for the named file.

        Raises:
          KeyError: if the file can not be found in the pool.