code: def BokehApplication(
      applications, server, prefix="/", template_variables=None
  ):
      template_variables = template_variables or {}
      prefix = "/" + prefix.strip("/") + "/" if prefix else "/"
  
      extra = {"prefix": prefix, **template_variables}
  
      funcs = {
          k: functools.partial(v, server, extra)
          for k, v in applications.items()
      }
      apps = {
          k: Application(FunctionHandler(v)) for k, v in funcs.items()
      }
  
      kwargs = dask.config.get(
          "distributed.scheduler.dashboard.bokeh-application"
      ).copy()
      extra_websocket_origins = create_hosts_allowlist(
          kwargs.pop("allow_websocket_origin"), server.http_server.port
      )
  
      return DaskBokehTornado(
          apps,
          prefix=prefix,
          use_index=False,
          extra_websocket_origins=extra_websocket_origins,
          absolute_url="",
          **kwargs,
      )
  
file_path: distributed/distributed/dashboard/core.py
imports: from __future__ import annotations
  import functools
  import warnings
  from bokeh.application import Application
  from bokeh.application.handlers.function import FunctionHandler
  from bokeh.resources import Resources
  from bokeh.server.util import create_hosts_allowlist
  from packaging.version import parse
  import dask
  from distributed.dashboard.utils import BOKEH_VERSION
  from distributed.versions import BOKEH_REQUIREMENT
label_desc: Use image node_id 1 for calling a global function with example usage: BokehApplication(applications, server, prefix, template_variables) and returns: DaskBokehTornado