code: def setup(app: Sphinx) -> dict[str, Any]:
      from docutils.parsers.rst import roles
  
      for rolename, nodeclass in generic_docroles.items():
          generic = roles.GenericRole(rolename, nodeclass)
          role = roles.CustomRole(
              rolename, generic, {"classes": [rolename]}
          )
          roles.register_local_role(rolename, role)
  
      for rolename, func in specific_docroles.items():
          roles.register_local_role(rolename, func)
  
      # Since docutils registers it as a canonical role, override it as a
      # canonical role as well.
      roles.register_canonical_role("code", code_role)
  
      return {
          "version": "builtin",
          "parallel_read_safe": True,
          "parallel_write_safe": True,
      }
  
imports: from __future__ import annotations
  import re
  from typing import TYPE_CHECKING, Any
  import docutils.parsers.rst.directives
  import docutils.parsers.rst.roles
  import docutils.parsers.rst.states
  from docutils import nodes, utils
  from sphinx import addnodes
  from sphinx.locale import _, __
  from sphinx.util import ws_re
  from sphinx.util.docutils import ReferenceRole, SphinxRole
label_desc: Use image node_id 2 for calling a global function with example usage: setup(app) and returns: dict