code: def visit_class(cls, done=None):
      skip = {
          "__doc__",
          "__dict__",
          "__module__",
          "__weakref__",
          "__pyx_vtable__",
          "__lt__",
          "__le__",
          "__ge__",
          "__gt__",
          "__str__",
          "__repr__",
      }
      special = {
          "__len__": ("self", "int", None),
          "__bool__": ("self", "bool", None),
          "__hash__": ("self", "int", None),
          "__int__": ("self", "int", None),
          "__index__": ("self", "int", None),
          "__eq__": ("self", "__other: object", "bool", None),
          "__ne__": ("self", "__other: object", "bool", None),
          "__buffer__": ("self", "__flags: int", "memoryview", (3, 12)),
      }
      constructor = (
          "__new__",
          "__init__",
      )
  
      override = OVERRIDE.get(cls.__name__, {})
      done = set() if done is None else done
      lines = Lines()
  
      try:
  
          class sub(cls):
              pass
  
          final = False
      except TypeError:
          final = True
      if final:
          lines.add = "@final"
      base = cls.__base__
      if base is object:
          lines.add = f"class {cls.__name__}:"
      else:
          lines.add = f"class {cls.__name__}({base.__name__}):"
      lines.level += 1
  
      for name in constructor:
          if name in done:
              continue
          if name in override:
              done.add(name)
              lines.add = override[name]
              continue
          if name in cls.__dict__:
              done.add(name)
              lines.add = visit_constructor(cls, name)
              continue
  
      if "__hash__" in cls.__dict__:
          if cls.__hash__ is None:
              done.add("__hash__")
  
      dct = cls.__dict__
      keys = list(dct.keys())
      for name in keys:
          if name in done:
              continue
  
          if name in skip:
              continue
  
          if name in override:
              done.add(name)
              lines.add = override[name]
              continue
  
          if name in special:
              done.add(name)
              *args, retv, py = special[name]
              sig = f"{name}({', '.join(args)}) -> {retv}"
              if py is not None:
                  lines.add = f"if sys.version_info >= {py}:"
                  lines.level += 1
              lines.add = f"def {sig}: ..."
              if py is not None:
                  lines.level -= 1
              continue
  
          attr = getattr(cls, name)
  
          if is_method(attr):
              done.add(name)
              if name == attr.__name__:
                  obj = dct[name]
                  if is_classmethod(obj):
                      lines.add = "@classmethod"
                  elif is_staticmethod(obj):
                      lines.add = "@staticmethod"
                  lines.add = visit_method(attr)
              elif True:
                  lines.add = f"{name} = {attr.__name__}"
              continue
  
          if is_datadescr(attr):
              done.add(name)
              lines.add = visit_datadescr(attr)
              continue
  
          if is_property(attr):
              done.add(name)
              lines.add = visit_property(attr, name)
              continue
  
      leftovers = [
          name for name in keys if name not in done and name not in skip
      ]
      if leftovers:
          raise RuntimeError(f"leftovers: {leftovers}")
  
      lines.level -= 1
      return lines
  
imports: import os
  import inspect
  import textwrap
label_desc: Use image node_id 17 for calling a global function with example usage: visit_class(cls, done) and returns: lines