code: def _apis(apis: str | None) -> str | None:
      if apis is None:
          return
  
      # options lines might need a ruff noqa comment for line length, etc
      apis = apis.split("#")[0].strip()
  
      results = []
  
      for api in (api.strip() for api in apis.split(",")):
          last = api.split(".")[-1]
  
          # handle a few special cases more carefully
          if api.startswith("bokeh.models"):
              results.append(f":class:`bokeh.models.{last} <{api}>`")
          elif "figure." in api:
              results.append(f":meth:`figure.{last} <{api}>`")
          elif "GMap." in api:
              results.append(f":meth:`GMap.{last} <{api}>`")
  
          # just use class role as-is for anything else
          else:
              results.append(f":class:`{api}`")
  
      return ", ".join(results)
  
file_path: bokeh/src/bokeh/sphinxext/bokeh_example_metadata.py
imports: from __future__ import annotations
  from sphinx.util import logging
  from docutils.parsers.rst.directives import unchanged
  from sphinx.errors import SphinxError
  from .None import PARALLEL_SAFE
  from .bokeh_directive import BokehDirective
  from .templates import EXAMPLE_METADATA
  from .util import get_sphinx_resources
label_desc: Use image node_id 3 for calling a global function with example usage: _apis(apis) and returns: str