class_docstr: Provide a mechanism for Bokeh applications to build up new Bokeh
  Documents.
class_docstr_tok: ["Provide","a","mechanism","for","Bokeh","applications","to","build","up","new","Bokeh","Documents","."]
docstr: Modify an application document in a specified manner.
  
  When a Bokeh server session is initiated, the Bokeh server asks the
  Application for a new Document to service the session. To do this,
  the Application first creates a new empty Document, then it passes
  this Document to the ``modify_document`` method of each of its
  handlers. When all handlers have updated the Document, it is used to
  service the user session.
  
  *Subclasses must implement this method*
  
  Args:
      doc (Document) : A Bokeh Document to update in-place
  
  Returns:
      Document
docstr_tok: ["Modify","an","application","document","in","a","specified","manner",".","When","a","Bokeh","server","session","is","initiated",",","the","Bokeh","server","asks","the","Application","for","a","new","Document","to","service","the","session",".","To","do","this",",","the","Application","first","creates","a","new","empty","Document",",","then","it","passes","this","Document","to","the","``","modify_document","``","method","of","each","of","its","handlers",".","When","all","handlers","have","updated","the","Document",",","it","is","used","to","service","the","user","session",".","*","Subclasses","must","implement","this","method","*","Args",":","doc","(","Document",")",":","A","Bokeh","Document","to","update","in-place","Returns",":","Document"]
code: def modify_document(self, doc: Document) -> None:
      """Modify an application document in a specified manner.
  
      When a Bokeh server session is initiated, the Bokeh server asks the
      Application for a new Document to service the session. To do this,
      the Application first creates a new empty Document, then it passes
      this Document to the ``modify_document`` method of each of its
      handlers. When all handlers have updated the Document, it is used to
      service the user session.
  
      *Subclasses must implement this method*
  
      Args:
          doc (Document) : A Bokeh Document to update in-place
  
      Returns:
          Document
  
      """
      raise NotImplementedError("implement modify_document()")
  
imports: from __future__ import annotations
  import logging
  import os
  import sys
  import traceback
  from typing import TYPE_CHECKING, Any
  from ...document import Document
  from ..application import ServerContext, SessionContext
label_desc: Use image node_id 6 for calling the Handler obj's underlying member method code with example usage: obj.modify_document(doc) without return types