class_docstr: Factory for creating Proto2 messages from descriptors in a pool.
docstr: Builds a proto2 message class based on the passed in descriptor.
  
  Passing a descriptor with a fully qualified name matching a previous
  invocation will cause the same class to be returned.
  
  Args:
    descriptor: The descriptor to build from.
  
  Returns:
    A class describing the passed in descriptor.
code: def GetPrototype(self, descriptor):
      """Builds a proto2 message class based on the passed in descriptor.
  
      Passing a descriptor with a fully qualified name matching a previous
      invocation will cause the same class to be returned.
  
      Args:
        descriptor: The descriptor to build from.
  
      Returns:
        A class describing the passed in descriptor.
      """
      if descriptor.full_name not in self._classes:
          descriptor_name = descriptor.name
          if str is bytes:  # PY2
              descriptor_name = descriptor.name.encode(
                  "ascii", "ignore"
              )
          result_class = reflection.GeneratedProtocolMessageType(
              descriptor_name,
              (message.Message,),
              {"DESCRIPTOR": descriptor, "__module__": None},
          )
          # If module not set, it wrongly points to the reflection.py module.
          self._classes[descriptor.full_name] = result_class
          for field in descriptor.fields:
              if field.message_type:
                  self.GetPrototype(field.message_type)
          for extension in result_class.DESCRIPTOR.extensions:
              if (
                  extension.containing_type.full_name
                  not in self._classes
              ):
                  self.GetPrototype(extension.containing_type)
              extended_class = self._classes[
                  extension.containing_type.full_name
              ]
              extended_class.RegisterExtension(extension)
      return self._classes[descriptor.full_name]
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/deps/protobuf/python/google/protobuf/message_factory.py
imports: from google.protobuf import descriptor_pool
  from google.protobuf import message
  from google.protobuf import reflection
label_desc: Use image node_id 2 for calling the MessageFactory obj's underlying member method code with example usage: obj.GetPrototype(descriptor) and returns: self