code: def generate_mypy_stubs(
      descriptors: Descriptors, response: plugin.CodeGeneratorResponse
  ) -> None:
      for name, fd in descriptors.to_generate.items():
          pkg_writer = PkgWriter(fd, descriptors)
          pkg_writer.write_enums(fd.enum_type)
          pkg_writer.write_messages(fd.message_type, "")
          pkg_writer.write_services(fd.service)
  
          assert name == fd.name
          assert fd.name.endswith(".proto")
          output = response.file.add()
          output.name = fd.name[:-6].replace("-", "_") + "_pb2.pyi"
          output.content = HEADER + pkg_writer.write()
          print("Writing mypy to", output.name, file=sys.stderr)
  
file_path: onnx/tools/protoc-gen-mypy.py
imports: import sys
  from collections import defaultdict
  from contextlib import contextmanager
  from typing import Any, Callable, Dict, Generator, List, Optional, Set, cast
label_desc: Use image node_id 2 for calling a global function with example usage: generate_mypy_stubs(descriptors, response) without return types