code: def init_annotations(app):
      annotations = Annotations(
          path.join(app.srcdir, app.config.refcount_file),
          path.join(app.srcdir, app.config.stable_abi_file),
      )
      app.connect("doctree-read", annotations.add_annotations)
  
      class LimitedAPIList(Directive):
          has_content = False
          required_arguments = 0
          optional_arguments = 0
          final_argument_whitespace = True
  
          def run(self):
              content = []
              for record in annotations.stable_abi_data.values():
                  role = REST_ROLE_MAP[record["role"]]
                  name = record["name"]
                  content.append(f"* :c:{role}:`{name}`")
  
              pnode = nodes.paragraph()
              self.state.nested_parse(StringList(content), 0, pnode)
              return [pnode]
  
      app.add_directive("limited-api-list", LimitedAPIList)
  
file_path: cpython/Doc/tools/extensions/c_annotations.py
imports: from os import path
  import docutils
  from docutils import nodes
  from docutils.parsers.rst import directives
  from docutils.parsers.rst import Directive
  from docutils.statemachine import StringList
  from sphinx.locale import _
  import csv
  from sphinx import addnodes
  from sphinx.domains.c import CObject
label_desc: Use image node_id 1 for calling a global function with example usage: init_annotations(app) and returns: list