class_docstr: A collection of protobufs dynamically constructed by descriptor protos.
class_docstr_tok: ["A","collection","of","protobufs","dynamically","constructed","by","descriptor","protos","."]
docstr: Adds an EnumDescriptor to the pool.
  
  This method also registers the FileDescriptor associated with the enum.
  
  Args:
    enum_desc: An EnumDescriptor.
code: def _AddEnumDescriptor(self, enum_desc):
      """Adds an EnumDescriptor to the pool.
  
      This method also registers the FileDescriptor associated with the enum.
  
      Args:
        enum_desc: An EnumDescriptor.
      """
  
      if not isinstance(enum_desc, descriptor.EnumDescriptor):
          raise TypeError(
              "Expected instance of descriptor.EnumDescriptor."
          )
  
      file_name = enum_desc.file.name
      self._CheckConflictRegister(
          enum_desc, enum_desc.full_name, file_name
      )
      self._enum_descriptors[enum_desc.full_name] = enum_desc
  
      # Top enum values need to be indexed.
      # Count the number of dots to see whether the enum is toplevel or nested
      # in a message. We cannot use enum_desc.containing_type at this stage.
      if enum_desc.file.package:
          top_level = (
              enum_desc.full_name.count(".")
              - enum_desc.file.package.count(".")
              == 1
          )
      else:
          top_level = enum_desc.full_name.count(".") == 0
      if top_level:
          file_name = enum_desc.file.name
          package = enum_desc.file.package
          for enum_value in enum_desc.values:
              full_name = _NormalizeFullyQualifiedName(
                  ".".join((package, enum_value.name))
              )
              self._CheckConflictRegister(
                  enum_value, full_name, file_name
              )
              self._top_enum_values[full_name] = enum_value
      self._AddFileDescriptor(enum_desc.file)
  
imports: import collections
  import warnings
  from google.protobuf import descriptor
  from google.protobuf import descriptor_database
  from google.protobuf import text_encoding
label_desc: Use image node_id 8 for calling the DescriptorPool obj's underlying member method code with example usage: obj._AddEnumDescriptor(enum_desc) without return types