code: def __init__(self, request: plugin_pb2.CodeGeneratorRequest) -> None:
      files = {f.name: f for f in request.proto_file}
      to_generate = {n: files[n] for n in request.file_to_generate}
      self.files: Dict[str, d.FileDescriptorProto] = files
      self.to_generate: Dict[str, d.FileDescriptorProto] = to_generate
      self.messages: Dict[str, d.DescriptorProto] = {}
      self.message_to_fd: Dict[str, d.FileDescriptorProto] = {}
  
      def _add_enums(
          enums: "RepeatedCompositeFieldContainer[d.EnumDescriptorProto]",
          prefix: str,
          _fd: d.FileDescriptorProto,
      ) -> None:
          for enum in enums:
              self.message_to_fd[prefix + enum.name] = _fd
              self.message_to_fd[
                  prefix + enum.name + ".ValueType"
              ] = _fd
  
      def _add_messages(
          messages: "RepeatedCompositeFieldContainer[d.DescriptorProto]",
          prefix: str,
          _fd: d.FileDescriptorProto,
      ) -> None:
          for message in messages:
              self.messages[prefix + message.name] = message
              self.message_to_fd[prefix + message.name] = _fd
              sub_prefix = prefix + message.name + "."
              _add_messages(message.nested_type, sub_prefix, _fd)
              _add_enums(message.enum_type, sub_prefix, _fd)
  
      for fd in request.proto_file:
          start_prefix = "." + fd.package + "." if fd.package else "."
          _add_messages(fd.message_type, start_prefix, fd)
          _add_enums(fd.enum_type, start_prefix, fd)
  
imports: from __future__ import annotations
  import sys
  from collections import defaultdict
  from contextlib import contextmanager
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Optional, Set, Sequence, Tuple
  import google.protobuf.descriptor_pb2
  from google.protobuf.compiler import plugin_pb2
  from google.protobuf.internal.containers import RepeatedCompositeFieldContainer
  from google.protobuf.internal.well_known_types import WKTBASES
  from .None import extensions_pb2
label_desc: Use image node_id 1 to create a new Descriptors object from inherited base classes: object with example: obj = Descriptors(request)