code: def encode_contents(self):
          
  
          if self.variable_size:
              resp_length = 1
          else:
              resp_length = self.fixed_response_size << 1
  
          header = struct.pack("<HBB", self.rpc_id, self.address, resp_length)
          return bytearray(header) + self.payload
docs: Encode the contents of this update record without including a record header.
  
          Returns:
              bytearray: The encoded contents.