class_docstr: Writes a single pyi file
class_docstr_tok: ["Writes","a","single","pyi","file"]
code: def write_services(
      self,
      services: Iterable[d.ServiceDescriptorProto],
      scl_prefix: SourceCodeLocation,
  ) -> None:
      wl = self._write_line
      for i, service in enumerate(services):
          scl = scl_prefix + [i]
          class_name = (
              service.name
              if service.name not in PYTHON_RESERVED
              else "_r_" + service.name
          )
          # The service definition interface
          wl(
              "class {}({}, metaclass={}):",
              class_name,
              self._import("google.protobuf.service", "Service"),
              self._import("abc", "ABCMeta"),
          )
          with self._indent():
              if self._write_comments(scl):
                  wl("")
              self.write_methods(
                  service, class_name, is_abstract=True, scl_prefix=scl
              )
          wl("")
  
          # The stub client
          stub_class_name = service.name + "_Stub"
          wl("class {}({}):", stub_class_name, class_name)
          with self._indent():
              if self._write_comments(scl):
                  wl("")
              wl(
                  "def __init__(self, rpc_channel: {}) -> None: ...",
                  self._import("google.protobuf.service", "RpcChannel"),
              )
              self.write_methods(
                  service,
                  stub_class_name,
                  is_abstract=False,
                  scl_prefix=scl,
              )
          wl("")
  
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 17 for calling the PkgWriter obj's underlying member method code with example usage: obj.write_services(services, scl_prefix) without return types