code: def set_curdoc(doc: Document) -> None:
      """Configure the current document (returned by curdoc()).
  
      Args:
          doc (Document) : new Document to use for curdoc()
  
      Returns:
          None
  
      .. warning::
          Calling this function will replace any existing document.
  
      """
      curstate().document = doc
  
file_path: bokeh/src/bokeh/io/doc.py
imports: from __future__ import annotations
  import logging
  import weakref
  from contextlib import contextmanager
  from typing import TYPE_CHECKING, Iterator, cast
  from ..document import Document
  from .state import curstate
label_desc: Use image node_id 3 for calling a global function with example usage: set_curdoc(doc) without return types