code: def _summarize_registered_kls(dist_classes):
      """Returns a str of registered KLs, to append to the doc for kl_divergence."""
      maxdists = 6  # Only show up to N subclasses per p/q.
      ps, qs = [], []
      for p, q in sorted(
          _DIVERGENCES,
          key=lambda p_q: (p_q[0].__name__, p_q[1].__name__),
      ):
          subps = sorted(
              [
                  d
                  for d in dist_classes
                  if issubclass(d, p) and d is not p
              ],
              key=lambda d: d.__name__,
          )
          subqs = sorted(
              [
                  d
                  for d in dist_classes
                  if issubclass(d, q) and d is not q
              ],
              key=lambda d: d.__name__,
          )
          ps.append(p.__name__)
          for subp in subps[:maxdists]:
              ps.append("{} +".format(subp.__name__))
          if len(subps) > maxdists:
              ps.append("{} more +".format(len(subps) - maxdists))
          ps.extend(
              [""]
              * (
                  len(subqs[: maxdists + 1])
                  - len(subps[: maxdists + 1])
              )
          )
  
          qs.append(q.__name__)
          for subq in subqs[:maxdists]:
              qs.append("+ {}".format(subq.__name__))
          if len(subqs) > maxdists:
              qs.append("+ {} more".format(len(subqs) - maxdists))
          qs.extend(
              [""]
              * (
                  len(subps[: maxdists + 1])
                  - len(subqs[: maxdists + 1])
              )
          )
      maxp = max(map(len, ps))
      rows = []
      for p, q in [("distribution_a", "distribution_b")] + list(
          zip(ps, qs)
      ):
          rows.append(
              "{}{} {} {}".format(
                  " " * (maxp - len(p)),
                  p,
                  "  " if "+" in (p + q) else "||",
                  q,
              )
          )
      return """
    Built-in KL(distribution_a || distribution_b) registrations:
  
    ```text
    {}
    {}
    {}
    ```
    """.format(
          rows[0], "=" * max(map(len, rows)), "\n  ".join(rows[1:])
      )
  
file_path: probability/tensorflow_probability/python/distributions/kullback_leibler.py
imports: import inspect
  import six
  import tensorflow.compat.v2
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 5 for calling a global function with example usage: _summarize_registered_kls(dist_classes) and returns: str