code: def generate_mypy_stubs(
      descriptors: Descriptors,
      response: plugin_pb2.CodeGeneratorResponse,
      quiet: bool,
      readable_stubs: bool,
      relax_strict_optional_primitives: bool,
  ) -> None:
      for name, fd in descriptors.to_generate.items():
          pkg_writer = PkgWriter(
              fd,
              descriptors,
              readable_stubs,
              relax_strict_optional_primitives,
              grpc=False,
          )
  
          pkg_writer.write_module_attributes()
          pkg_writer.write_enums(
              fd.enum_type,
              "",
              [d.FileDescriptorProto.ENUM_TYPE_FIELD_NUMBER],
          )
          pkg_writer.write_messages(
              fd.message_type,
              "",
              [d.FileDescriptorProto.MESSAGE_TYPE_FIELD_NUMBER],
          )
          pkg_writer.write_extensions(
              fd.extension,
              [d.FileDescriptorProto.EXTENSION_FIELD_NUMBER],
          )
          if fd.options.py_generic_services:
              pkg_writer.write_services(
                  fd.service,
                  [d.FileDescriptorProto.SERVICE_FIELD_NUMBER],
              )
  
          assert name == fd.name
          assert fd.name.endswith(".proto")
          output = response.file.add()
          output.name = (
              fd.name[:-6].replace("-", "_").replace(".", "/")
              + "_pb2.pyi"
          )
          output.content = pkg_writer.write()
  
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 3 for calling a global function with example usage: generate_mypy_stubs(descriptors, response, quiet, readable_stubs, relax_strict_optional_primitives) without return types