code: def assemble_buffer(self, buf_header, buf_payload):
          ''' Add a buffer header and payload that we read from the socket.
  
          This differs from add_buffer() because we're validating vs.
          the header's num_buffers, instead of filling in the header.
  
          Args:
              buf_header (``JSON``) : a buffer header
              buf_payload (``JSON`` or bytes) : a buffer payload
  
          Returns:
              None
  
          Raises:
              ProtocolError
          '''
          if self.header.get('num_buffers', 0) <= len(self._buffers):
              raise ProtocolError("too many buffers received expecting " + str(self.header['num_buffers']))
          self._buffers.append((buf_header, buf_payload)f assemble_buffer(self, buf_header, buf_payload):
          ''' Add a buffer header and payload that we read from the socket.
  
          This differs from add_buffer() because we're validating vs.
          the header's num_buffers, instead of filling in the header.
  
          Args:
              buf_header (``JSON``) : a buffer header
              buf_payload (``JSON`` or bytes) : a buffer payload
  
          Returns:
              None
  
          Raises:
              ProtocolError
          '''
          if self.header.get('num_buffers', 0) <= len(self._buffers):
              raise ProtocolError("too many buffers received expecting " + str(self.header['num_buffers']))
          self._buffers.append((buf_header, buf_payload))
docs: Add a buffer header and payload that we read from the socket.
  
          This differs from add_buffer() because we're validating vs.
          the header's num_buffers, instead of filling in the header.
  
          Args:
              buf_header (``JSON``) : a buffer header
              buf_payload (``JSON`` or bytes) : a buffer payload
  
          Returns:
              None
  
          Raises:
              ProtocolError