class_docstr: A database of Python generated symbols.
class_docstr_tok: ["A","database","of","Python","generated","symbols","."]
docstr: Gets all registered messages from a specified file.
  
  Only messages already created and registered will be returned; (this is the
  case for imported _pb2 modules)
  But unlike MessageFactory, this version also returns already defined nested
  messages, but does not register any message extensions.
  
  Args:
    files: The file names to extract messages from.
  
  Returns:
    A dictionary mapping proto names to the message classes.
  
  Raises:
    KeyError: if a file could not be found.
docstr_tok: ["Gets","all","registered","messages","from","a","specified","file",".","Only","messages","already","created","and","registered","will","be","returned",";","(","this","is","the","case","for","imported","_pb2","modules",")","But","unlike","MessageFactory",",","this","version","also","returns","already","defined","nested","messages",",","but","does","not","register","any","message","extensions",".","Args",":","files",":","The","file","names","to","extract","messages","from",".","Returns",":","A","dictionary","mapping","proto","names","to","the","message","classes",".","Raises",":","KeyError",":","if","a","file","could","not","be","found","."]
code: def GetMessages(self, files):
      # TODO(amauryfa): Fix the differences with MessageFactory.
      """Gets all registered messages from a specified file.
  
      Only messages already created and registered will be returned; (this is the
      case for imported _pb2 modules)
      But unlike MessageFactory, this version also returns already defined nested
      messages, but does not register any message extensions.
  
      Args:
        files: The file names to extract messages from.
  
      Returns:
        A dictionary mapping proto names to the message classes.
  
      Raises:
        KeyError: if a file could not be found.
      """
  
      def _GetAllMessageNames(desc):
          """Walk a message Descriptor and recursively yields all message names."""
          yield desc.full_name
          for msg_desc in desc.nested_types:
              for full_name in _GetAllMessageNames(msg_desc):
                  yield full_name
  
      result = {}
      for file_name in files:
          file_desc = self.pool.FindFileByName(file_name)
          for msg_desc in file_desc.message_types_by_name.values():
              for full_name in _GetAllMessageNames(msg_desc):
                  try:
                      result[full_name] = self._classes[full_name]
                  except KeyError:
                      # This descriptor has no registered class, skip it.
                      pass
      return result
  
file_path: coremltools/deps/protobuf/python/google/protobuf/symbol_database.py
imports: from google.protobuf import descriptor_pool
  from google.protobuf import message_factory
label_desc: Use image node_id 6 for calling the SymbolDatabase obj's underlying member method code with example usage: obj.GetMessages(files) and returns: result