code: def write_packet(self, payload):
          
          # Internal note: when you build packet manually and calls
          # _write_bytes() directly, you should set self._next_seq_id properly.
          data = pack_int24(len(payload)) + int2byte(self._next_seq_id) + payload
          self._write_bytes(data)
          self._next_seq_id = (self._next_seq_id + 1) % 256
docs: Writes an entire "mysql packet" in its entirety to the network
          addings its length and sequence number.