code: def test_safe_to_fork(self) -> None:
      def noop(doc: Document):
          pass
  
      handler = bahf.FunctionHandler(noop)
      doc = Document()
      assert handler.safe_to_fork
      handler.modify_document(doc)
      if handler.failed:
          raise RuntimeError(handler.error)
      assert not handler.safe_to_fork
  
file_path: bokeh/tests/unit/bokeh/application/handlers/test_function.py
imports: from __future__ import annotations
  import pytest
  from bokeh.core.properties import Instance, Int, Nullable
  from bokeh.document import Document
  from bokeh.model import Model
  import bokeh.application.handlers.function
label_desc: Use image node_id 3 for calling the Test_FunctionHandler obj's underlying member method code with example usage: obj.test_safe_to_fork() without return types