class_docstr: The Message base class encapsulates creating, assembling, and
  validating the integrity of Bokeh Server messages. Additionally, it
  provide hooks
class_docstr_tok: ["The","Message","base","class","encapsulates","creating",",","assembling",",","and","validating","the","integrity","of","Bokeh","Server","messages",".","Additionally",",","it","provide","hooks"]
docstr: Associate a buffer header and payload with this message.
  
  Args:
      buf_header (``JSON``) : a buffer header
      buf_payload (``JSON`` or bytes) : a buffer payload
  
  Returns:
      None
  
  Raises:
      MessageError
docstr_tok: ["Associate","a","buffer","header","and","payload","with","this","message",".","Args",":","buf_header","(","``","JSON","``",")",":","a","buffer","header","buf_payload","(","``","JSON","``","or","bytes",")",":","a","buffer","payload","Returns",":","None","Raises",":","MessageError"]
code: def add_buffer(self, buffer: Buffer) -> None:
      """Associate a buffer header and payload with this message.
  
      Args:
          buf_header (``JSON``) : a buffer header
          buf_payload (``JSON`` or bytes) : a buffer payload
  
      Returns:
          None
  
      Raises:
          MessageError
  
      """
      if "num_buffers" in self._header:
          self._header["num_buffers"] += 1
      else:
          self._header["num_buffers"] = 1
  
      self._header_json = None
      self._buffers.append(buffer)
  
imports: from __future__ import annotations
  import logging
  import json
  from typing import TYPE_CHECKING, Any, ClassVar, Generic, TypedDict, TypeVar
  import bokeh.util.serialization
  from ..core.json_encoder import serialize_json
  from ..core.serialization import Buffer, Serialized
  from ..core.types import ID
  from .exceptions import MessageError, ProtocolError
label_desc: Use image node_id 4 for calling the Message obj's underlying member method code with example usage: obj.add_buffer(buffer) without return types