class_docstr: Receive wire message fragments and assemble complete Bokeh server
  message objects.
  
  On ``MessageError`` or ``ValidationError``, the receiver will reset its
  state and attempt to consume a new message.
  
  The *fragment* received can be either bytes or unicode, depending on
  the transport's semantics (WebSocket allows both).
  
  .. code-block:: python
  
      [
          # these are required
          b'{header}',        # serialized header dict
          b'{metadata}',      # serialized metadata dict
          b'{content},        # serialized content dict
  
          # these are optional, and come in pairs; header contains num_buffers
          b'{buf_header}',    # serialized buffer header dict
          b'array'            # raw buffer payload data
          ...
      ]
  
  The ``header`` fragment will have the form:
  
  .. code-block:: python
  
      header = {
          # these are required
          'msgid'       : <str> # a unique id for the message
          'msgtype'     : <str> # a message type, e.g. 'ACK', 'PATCH-DOC', etc
  
          # these are optional
          'num_buffers' : <int> # the number of additional buffers, if any
      }
  
  The ``metadata`` fragment may contain any arbitrary information. It is not
  processed by Bokeh for any purpose, but may be useful for external
  monitoring or instrumentation tools.
  
  The ``content`` fragment is defined by the specific message type.
class_docstr_tok: ["Receive","wire","message","fragments","and","assemble","complete","Bokeh","server","message","objects",".","On","``","MessageError","``","or","``","ValidationError","``",",","the","receiver","will","reset","its","state","and","attempt","to","consume","a","new","message",".","The","*","fragment","*","received","can","be","either","bytes","or","unicode",",","depending","on","the","transport","'s","semantics","(","WebSocket","allows","both",")",".","..","code-block",":",":","python","[","#","these","are","required","b","'","{","header","}","'",",","#","serialized","header","dict","b","'","{","metadata","}","'",",","#","serialized","metadata","dict","b","'","{","content","}",",","#","serialized","content","dict","#","these","are","optional",",","and","come","in","pairs",";","header","contains","num_buffers","b","'","{","buf_header","}","'",",","#","serialized","buffer","header","dict","b'array","'","#","raw","buffer","payload","data","...","]","The","``","header","``","fragment","will","have","the","form",":","..","code-block",":",":","python","header","=","{","#","these","are","required","'msgid","'",":","<","str",">","#","a","unique","id","for","the","message","'msgtype","'",":","<","str",">","#","a","message","type",",","e.g",".","'ACK","'",",","'PATCH-DOC","'",",","etc","#","these","are","optional","'num_buffers","'",":","<","int",">","#","the","number","of","additional","buffers",",","if","any","}","The","``","metadata","``","fragment","may","contain","any","arbitrary","information",".","It","is","not","processed","by","Bokeh","for","any","purpose",",","but","may","be","useful","for","external","monitoring","or","instrumentation","tools",".","The","``","content","``","fragment","is","defined","by","the","specific","message","type","."]
code: def _CONTENT(self, fragment: Fragment) -> None:
      content = self._assume_text(fragment)
      self._fragments.append(content)
  
      header_json, metadata_json, content_json = (
          self._assume_text(x) for x in self._fragments[:3]
      )
  
      self._partial = self._protocol.assemble(
          header_json, metadata_json, content_json
      )
  
      self._check_complete()
  
file_path: bokeh/src/bokeh/protocol/receiver.py
imports: from __future__ import annotations
  import logging
  import json
  from typing import TYPE_CHECKING, Any, Callable, Union, cast
  from .exceptions import ValidationError
  from .message import BufferHeader, Message
label_desc: Use image node_id 4 for calling the Receiver obj's underlying member method code with example usage: obj._CONTENT(fragment) without return types