class_docstr: A Handler that accepts a plain python function to use for modifying
  Bokeh Documents.
  
  For example, the following code configures a handler with a function that
  adds an empty plot to a Document:
  
  .. code-block:: python
  
      def add_empty_plot(doc: Document):
          p = figure(x_range=(0, 10), y_range=(0, 10))
          doc.add_root(p)
          return doc
  
      handler = FunctionHandler(add_empty_plot)
  
  This handler could be configured on an Application, and the Application
  would run this function every time a new session is created.
docstr: Whether it is still safe for the Bokeh server to fork new workers.
  
  ``False`` if ``modify_doc`` has already been called.
docstr_tok: ["Whether","it","is","still","safe","for","the","Bokeh","server","to","fork","new","workers",".","``","False","``","if","``","modify_doc","``","has","already","been","called","."]
code: def safe_to_fork(self) -> bool:
      """Whether it is still safe for the Bokeh server to fork new workers.
  
      ``False`` if ``modify_doc`` has already been called.
  
      """
      return self._safe_to_fork
  
file_path: bokeh/src/bokeh/application/handlers/function.py
imports: from __future__ import annotations
  import logging
  from typing import Callable
  from ...document import Document
  from ...util.callback_manager import _check_callback
  from .handler import Handler, handle_exception
label_desc: Use image node_id 2 for calling the FunctionHandler obj's underlying member method code with example usage: obj.safe_to_fork() and returns: self