class_docstr: Given a list of classes, determines the set of classes that they inherit
  from all the way to the root "object", and then is able to generate a
  graphviz dot graph from them.
docstr: Given a class object, return a fully-qualified name.
  
  This works for things I've tested in matplotlib so far, but may not be
  completely general.
code: def class_name(
      self,
      cls: Any,
      parts: int = 0,
      aliases: dict[str, str] | None = None,
  ) -> str:
      """Given a class object, return a fully-qualified name.
  
      This works for things I've tested in matplotlib so far, but may not be
      completely general.
      """
      module = cls.__module__
      if module in ("__builtin__", "builtins"):
          fullname = cls.__name__
      else:
          fullname = f"{module}.{cls.__qualname__}"
      if parts == 0:
          result = fullname
      else:
          name_parts = fullname.split(".")
          result = ".".join(name_parts[-parts:])
      if aliases is not None and result in aliases:
          return aliases[result]
      return result
  
imports: from __future__ import annotations
  import builtins
  import hashlib
  import inspect
  import re
  from collections.abc import Iterable, Sequence
  from importlib import import_module
  from os import path
  from typing import TYPE_CHECKING, Any, cast
  from docutils import nodes
  from docutils.parsers.rst import directives
  import sphinx
  from sphinx import addnodes
  from sphinx.ext.graphviz import figure_wrapper, graphviz, render_dot_html, render_dot_latex, render_dot_texinfo
  from sphinx.util.docutils import SphinxDirective
label_desc: Use image node_id 4 for calling the InheritanceGraph obj's underlying member method code with example usage: obj.class_name(cls, parts, aliases) and returns: result, aliases