code: def process_PandasCompat_nodes(app, doctree, fromdocname):
      if not app.config.include_pandas_compat:
          for node in doctree.traverse(PandasCompat):
              node.parent.remove(node)
  
      # Replace all PandasCompatList nodes with a list of the collected
      # PandasCompats. Augment each PandasCompat with a backlink to the
      # original location.
      env = app.builder.env
  
      if not hasattr(env, "PandasCompat_all_pandas_compat"):
          env.PandasCompat_all_pandas_compat = []
  
      for node in doctree.traverse(PandasCompatList):
          if not app.config.include_pandas_compat:
              node.replace_self([])
              continue
  
          content = []
  
          for PandasCompat_info in env.PandasCompat_all_pandas_compat:
              para = nodes.paragraph()
  
              # Create a reference back to the original docstring
              newnode = nodes.reference("", "")
              innernode = nodes.emphasis(
                  translator("[source]"), translator("[source]")
              )
              newnode["refdocname"] = PandasCompat_info["docname"]
              newnode["refuri"] = app.builder.get_relative_uri(
                  fromdocname, PandasCompat_info["docname"]
              )
              newnode["refuri"] += (
                  "#" + PandasCompat_info["target"]["refid"]
              )
              newnode.append(innernode)
              para += newnode
  
              # Insert the reference node into PandasCompat node
              # Note that this node is a deepcopy from the original copy
              # in the docstring, so changing this does not affect that in the
              # doc.
              PandasCompat_info["PandasCompat"].append(para)
  
              # Insert the PandasCompand node into the PandasCompatList Node
              content.append(PandasCompat_info["PandasCompat"])
  
          node.replace_self(content)
  
imports: from docutils import nodes
  from docutils.parsers.rst import Directive
  from sphinx.locale import get_translation
  from sphinx.util.docutils import SphinxDirective
label_desc: Use image node_id 5 for calling a global function with example usage: process_PandasCompat_nodes(app, doctree, fromdocname) without return types