class_docstr: Factory for creating Proto2 messages from descriptors in a pool.
docstr: Obtains 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):
      """Obtains 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 not in self._classes:
          result_class = self.CreatePrototype(descriptor)
          # The assignment to _classes is redundant for the base implementation, but
          # might avoid confusion in cases where CreatePrototype gets overridden and
          # does not call the base implementation.
          self._classes[descriptor] = result_class
          return result_class
      return self._classes[descriptor]
  
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 2 for calling the MessageFactory obj's underlying member method code with example usage: obj.GetPrototype(descriptor) and returns: self, result_class