class_docstr: Writes a single pyi file
class_docstr_tok: ["Writes","a","single","pyi","file"]
code: def write_services(self, services: d.ServiceDescriptorProto) -> None:
      line = self._write_line
  
      for service in services:
          # The service definition interface
          line(
              "class {}({}, metaclass={}):",
              service.name,
              self._import("google.protobuf.service", "Service"),
              self._import("abc", "ABCMeta"),
          )
          with self._indent():
              for method in service.method:
                  line("@{}", self._import("abc", "abstractmethod"))
                  line("def {}(self,", method.name)
                  with self._indent():
                      line(
                          "rpc_controller: {},",
                          self._import(
                              "google.protobuf.service", "RpcController"
                          ),
                      )
                      line(
                          "request: {},",
                          self._import_message(method.input_type),
                      )
                      line(
                          "done: {}[{}[[{}], None]],",
                          self._import("typing", "Optional"),
                          self._import("typing", "Callable"),
                          self._import_message(method.output_type),
                      )
                  line(
                      ") -> {}[{}]: ...",
                      self._import("concurrent.futures", "Future"),
                      self._import_message(method.output_type),
                  )
  
          # The stub client
          line("class {}({}):", service.name + "_Stub", service.name)
          with self._indent():
              line(
                  "def __init__(self, rpc_channel: {}) -> None: ...",
                  self._import("google.protobuf.service", "RpcChannel"),
              )
  
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 8 for calling the PkgWriter obj's underlying member method code with example usage: obj.write_services(services) without return types