def compact(self):
        self._msg_start -= self._offset  # TODO(romain): May be wrongly <0.

        if self._offset > 0:
            if len(self._buffer) == self._offset:
                self._buffer = bytearray()
            else:
                self._buffer = self._buffer[self._offset:]
            self._offset = 0
Drop the bytes already read from this buffer.
dataset/ETHPy150Open rlenglet/openfaucet/src/openfaucet/buffer.py/ReceiveBuffer.compact