def encode(self):
header    = bytearray(<NUM_LIT:1>)<EOL>varHeader = encode16Int(self.msgId)<EOL>header[<NUM_LIT:0>] = <NUM_LIT> <EOL>header.extend(encodeLength(len(varHeader)))<EOL>header.extend(varHeader)<EOL>self.encoded = header<EOL>return str(header) if PY2 else bytes(header)<EOL>
Encode and store an UNSUBACK control packet