code: def setup(app):
      """Required Sphinx extension setup function."""
      app.add_node(sampledata_list)
      app.add_directive(
          "bokeh-example-index", BokehGalleryOverviewDirective
      )
      app.add_directive(
          "bokeh-sampledata-xref", BokehSampledataXrefDirective
      )
      app.connect("doctree-resolved", process_sampledata_xrefs)
      app.connect("env-purge-doc", purge_xrefs)
      app.connect("env-merge-info", merge_xrefs)
      app.connect("doctree-resolved", process_gallery_overview)
      app.connect("env-purge-doc", purge_gallery_xrefs)
      app.connect("env-merge-info", merge_gallery_xrefs)
      return PARALLEL_SAFE
  
imports: from __future__ import annotations
  from sphinx.util import logging
  from os.path import basename
  from docutils import nodes
  from sphinx.locale import _
  from .None import PARALLEL_SAFE
  from .bokeh_directive import BokehDirective
  from .util import get_sphinx_resources
label_desc: Use image node_id 1 for calling a global function with example usage: setup(app) and returns: PARALLEL_SAFE