class_docstr: Define the ``PATCH-DOC`` message for sending Document patch events
  between remote documents.
  
  The ``content`` fragment of for this message is has the form:
  
  .. code-block:: python
  
      {
          'events'     : <protocol document events>
          'references' : <model references>
      }
docstr_tok: []
code: def apply_to_document(
      self, doc: Document, setter: Setter | None = None
  ) -> None:
      """ """
      invoke_with_curdoc(
          doc, lambda: doc.apply_json_patch(self.payload, setter=setter)
      )
  
file_path: bokeh/src/bokeh/protocol/messages/patch_doc.py
imports: from __future__ import annotations
  import logging
  from typing import TYPE_CHECKING, Any
  from ...core.serialization import Serializer
  from ...document.callbacks import invoke_with_curdoc
  from ...document.json import PatchJson
  from ..message import Message
label_desc: Use image node_id 2 for calling the patch_doc obj's underlying member method code with example usage: obj.apply_to_document(doc, setter) without return types