code: def relabel_references(app, doc):
      # Change 'hash-ref' to 'ref' in label text
      for citation_node in doc.traverse(citation):
          if _ascend(citation_node, desc_content) is None:
              # no desc node in ancestry -> not in a docstring
              # XXX: should we also somehow check it's in a References section?
              continue
          label_node = citation_node[0]
          prefix, _, new_label = label_node[0].astext().partition("-")
          assert len(prefix) == HASH_LEN + 1
          new_text = Text(new_label)
          label_node.replace(label_node[0], new_text)
  
          for id in citation_node["backrefs"]:
              ref = doc.ids[id]
              ref_text = ref[0]
  
              # Sphinx has created pending_xref nodes with [reftext] text.
              def matching_pending_xref(node):
                  return (
                      isinstance(node, pending_xref)
                      and node[0].astext() == "[%s]" % ref_text
                  )
  
              for xref_node in ref.parent.traverse(
                  matching_pending_xref
              ):
                  xref_node.replace(
                      xref_node[0], Text("[%s]" % new_text)
                  )
              ref.replace(ref_text, new_text.copy())
  
imports: import re
  import pydoc
  import inspect
  import collections
  import hashlib
  from docutils.nodes import citation, Text
  import sphinx
  from sphinx.addnodes import pending_xref, desc_content
  from .docscrape_sphinx import get_doc_object, SphinxDocString
  from .None import __version__
  from docutils.statemachine import ViewList
  from sphinx.domains.c import CDomain
  from sphinx.domains.python import PythonDomain
label_desc: Use image node_id 3 for calling a global function with example usage: relabel_references(app, doc) and returns: unknown