code: def output_file(
      filename: PathLike,
      title: str = "Bokeh Plot",
      mode: ResourcesMode | None = None,
      root_dir: PathLike | None = None,
  ) -> None:
      """Configure the default output state to generate output saved
      to a file when :func:`show` is called.
  
      Does not change the current ``Document`` from ``curdoc()``. File and notebook
      output may be active at the same time, so e.g., this does not clear the
      effects of ``output_notebook()``.
  
      Args:
          filename (str) : a filename for saving the HTML document
  
          title (str, optional) : a title for the HTML document (default: "Bokeh Plot")
  
          mode (str, optional) : how to include BokehJS (default: ``'cdn'``)
              One of: ``'inline'``, ``'cdn'``, ``'relative(-dev)'`` or
              ``'absolute(-dev)'``. See :class:`bokeh.resources.Resources` for more details.
  
          root_dir (str, optional) : root directory to use for 'absolute' resources. (default: None)
              This value is ignored for other resource types, e.g. ``INLINE`` or
              ``CDN``.
  
      Returns:
          None
  
      .. note::
          Generally, this should be called at the beginning of an interactive
          session or the top of a script.
  
      .. warning::
          This output file will be overwritten on every save, e.g., each time
          |show| or |save| is invoked.
  
      """
      curstate().output_file(
          filename,
          title=title,
          mode=mode,
          root_dir=root_dir,
      )
  
file_path: bokeh/src/bokeh/io/output.py
imports: from __future__ import annotations
  import logging
  from typing import TYPE_CHECKING
  from .notebook import run_notebook_hook
  from .state import curstate
label_desc: Use image node_id 1 for calling a global function with example usage: output_file(filename, title, mode, root_dir) without return types