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: Creates a new message, assembled from JSON fragments.
  
  Args:
      header_json (``JSON``) :
  
      metadata_json (``JSON``) :
  
      content_json (``JSON``) :
  
  Returns:
      Message subclass
  
  Raises:
      MessageError
docstr_tok: ["Creates","a","new","message",",","assembled","from","JSON","fragments",".","Args",":","header_json","(","``","JSON","``",")",":","metadata_json","(","``","JSON","``",")",":","content_json","(","``","JSON","``",")",":","Returns",":","Message","subclass","Raises",":","MessageError"]
code: def assemble(
      cls, header_json: str, metadata_json: str, content_json: str
  ) -> Message[Content]:
      """Creates a new message, assembled from JSON fragments.
  
      Args:
          header_json (``JSON``) :
  
          metadata_json (``JSON``) :
  
          content_json (``JSON``) :
  
      Returns:
          Message subclass
  
      Raises:
          MessageError
  
      """
  
      try:
          header = json.loads(header_json)
      except ValueError:
          raise MessageError("header could not be decoded")
  
      try:
          metadata = json.loads(metadata_json)
      except ValueError:
          raise MessageError("metadata could not be decoded")
  
      try:
          content = json.loads(content_json)
      except ValueError:
          raise MessageError("content could not be decoded")
  
      msg = cls(header, metadata, content)
  
      msg._header_json = header_json
      msg._metadata_json = metadata_json
      msg._content_json = content_json
  
      return msg
  
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 3 for calling the Message obj's underlying member method code with example usage: obj.assemble(cls, header_json, metadata_json, content_json) and returns: msg