code: def get_sphinx_resources(include_bokehjs_api=False):
      docs_cdn = settings.docs_cdn()
  
      # if BOKEH_DOCS_CDN is unset just use default CDN resources
      if docs_cdn is None:
          resources = Resources(mode="cdn")
      else:
          # "BOKEH_DOCS_CDN=local" is used for building and displaying the docs locally
          if docs_cdn == "local":
              resources = Resources(
                  mode="server", root_url="/en/latest/"
              )
  
          # "BOKEH_DOCS_CDN=test:newthing" is used for building and deploying test docs to
          # a one-off location "en/newthing" on the docs site
          elif docs_cdn.startswith("test:"):
              version = docs_cdn.split(":")[1]
              resources = Resources(
                  mode="server", root_url=f"/en/{version}/"
              )
  
          # Otherwise assume it is a dev/rc/full release version and use CDN for it
          else:
              resources = Resources(mode="cdn", version=docs_cdn)
      if include_bokehjs_api:
          resources.components.append("bokeh-api")
      return resources
  
imports: from __future__ import annotations
  import os
  from pathlib import PurePath
  import logging
  from bokeh.resources import Resources
  from bokeh.settings import settings
label_desc: Use image node_id 1 for calling a global function with example usage: get_sphinx_resources(include_bokehjs_api) and returns: resources