class_docstr: Run source code which modifies a Document
  
      
docstr: Run Bokeh application code to update a ``Document``
  
  Args:
      doc (Document) : a ``Document`` to update
docstr_tok: ["Run","Bokeh","application","code","to","update","a","``","Document","``","Args",":","doc","(","Document",")",":","a","``","Document","``","to","update"]
code: def modify_document(self, doc: Document) -> None:
      """Run Bokeh application code to update a ``Document``
  
      Args:
          doc (Document) : a ``Document`` to update
  
      """
  
      module = self._runner.new_module()
  
      # If no module was returned it means the code runner has some permanent
      # unfixable problem, e.g. the configured source code has a syntax error
      if module is None:
          return
  
      # One reason modules are stored is to prevent the module from being gc'd
      # before the document is. A symptom of a gc'd module is that its globals
      # become None. Additionally stored modules are used to provide correct
      # paths to custom models resolver.
      doc.modules.add(module)
  
      with _monkeypatch_io(self._loggers):
          with patch_curdoc(doc):
              self._runner.run(module, self._make_post_doc_check(doc))
  
imports: from __future__ import annotations
  import logging
  from contextlib import contextmanager
  from os.path import basename, splitext
  from types import ModuleType
  from typing import Any, Callable, ClassVar
  from ...core.types import PathLike
  from ...document import Document
  from ...io.doc import curdoc, patch_curdoc
  from .code_runner import CodeRunner
  from .handler import Handler
label_desc: Use image node_id 6 for calling the CodeHandler obj's underlying member method code with example usage: obj.modify_document(doc) without return types