code: def rename_references(app, what, name, obj, options, lines):
      # decorate reference numbers so that there are no duplicates
      # these are later undecorated in the doctree, in relabel_references
      references = set()
      for line in lines:
          line = line.strip()
          m = re.match(
              "^.. \\[(%s)\\]" % app.config.numpydoc_citation_re,
              line,
              re.I,
          )
          if m:
              references.add(m.group(1))
  
      if references:
          # we use a hash to mangle the reference name to avoid invalid names
          sha = hashlib.sha256()
          sha.update(name.encode("utf8"))
          prefix = "R" + sha.hexdigest()[:HASH_LEN]
  
          for r in references:
              new_r = prefix + "-" + r
              for i, line in enumerate(lines):
                  lines[i] = lines[i].replace(
                      "[%s]_" % r, "[%s]_" % new_r
                  )
                  lines[i] = lines[i].replace(
                      ".. [%s]" % r, ".. [%s]" % new_r
                  )
  
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 1 for calling a global function with example usage: rename_references(app, what, name, obj, options, lines) without return types