class_docstr: Fallback various desc_* nodes to inline if translator does not support them.
class_docstr_tok: ["Fallback","various","desc_","*","nodes","to","inline","if","translator","does","not","support","them","."]
code: def run(self, **kwargs: Any) -> None:
      def has_visitor(
          translator: type[nodes.NodeVisitor], node: type[Element]
      ) -> bool:
          return hasattr(translator, "visit_%s" % node.__name__)
  
      try:
          translator = self.app.builder.get_translator_class()
      except AttributeError:
          # do nothing if no translator class is specified (e.g., on a dummy builder)
          return
  
      if issubclass(translator, SphinxTranslator):
          # subclass of SphinxTranslator supports desc_sig_element nodes automatically.
          return
  
      # for the leaf elements (desc_sig_element), the translator should support _all_,
      # unless there exists a generic visit_desc_sig_element default visitor
      if not all(
          has_visitor(translator, node)
          for node in addnodes.SIG_ELEMENTS
      ) and not has_visitor(translator, addnodes.desc_sig_element):
          self.fallback(addnodes.desc_sig_element)
  
      if not has_visitor(translator, addnodes.desc_inline):
          self.fallback(addnodes.desc_inline)
  
imports: from __future__ import annotations
  import re
  from typing import TYPE_CHECKING, Any, cast
  from docutils import nodes
  from docutils.nodes import Element, Node
  from sphinx import addnodes
  from sphinx.errors import NoUri
  from sphinx.locale import __
  from sphinx.transforms import SphinxTransform
  from sphinx.util import logging
  from sphinx.util.docutils import SphinxTranslator
  from sphinx.util.nodes import find_pending_xref_condition, process_only_nodes
label_desc: Use image node_id 1 for calling the SigElementFallbackTransform obj's underlying member method code with example usage: obj.run() and returns: hasattr