class_docstr: Factory for creating Proto2 messages from descriptors in a pool.
docstr: Builds a proto2 message class based on the passed in descriptor.
  
  Don't call this function directly, it always creates a new class. Call
  GetPrototype() instead. This method is meant to be overridden in subblasses
  to perform additional operations on the newly constructed class.
  
  Args:
    descriptor: The descriptor to build from.
  
  Returns:
    A class describing the passed in descriptor.
code: def CreatePrototype(self, descriptor):
      """Builds a proto2 message class based on the passed in descriptor.
  
      Don't call this function directly, it always creates a new class. Call
      GetPrototype() instead. This method is meant to be overridden in subblasses
      to perform additional operations on the newly constructed class.
  
      Args:
        descriptor: The descriptor to build from.
  
      Returns:
        A class describing the passed in descriptor.
      """
      descriptor_name = descriptor.name
      result_class = _GENERATED_PROTOCOL_MESSAGE_TYPE(
          descriptor_name,
          (message.Message,),
          {
              "DESCRIPTOR": descriptor,
              # If module not set, it wrongly points to message_factory module.
              "__module__": None,
          },
      )
      result_class._FACTORY = self  # pylint: disable=protected-access
      # Assign in _classes before doing recursive calls to avoid infinite
      # recursion.
      self._classes[descriptor] = 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 not in self._classes:
              self.GetPrototype(extension.containing_type)
          extended_class = self._classes[extension.containing_type]
          extended_class.RegisterExtension(extension)
      return result_class
  
file_path: catboost/contrib/python/protobuf/py3/google/protobuf/message_factory.py
imports: from google.protobuf.internal import api_implementation
  from google.protobuf import descriptor_pool
  from google.protobuf import message
label_desc: Use image node_id 3 for calling the MessageFactory obj's underlying member method code with example usage: obj.CreatePrototype(descriptor) and returns: result_class