code: def _write_packet(self, final):
          
          status = 1 if final else 0
          _header.pack_into(self._buf, 0, self._type, status, self._pos, 0, self._packet_no)
          self._packet_no = (self._packet_no + 1) % 256
          self._transport.sendall(self._buf[:self._pos])
          self._pos = 8
docs: Writes single TDS packet into underlying transport.
  
          Data for the packet is taken from internal buffer.
  
          :param final: True means this is the final packet in substream.