def get_packets(self):
        """
        :return: list of fully received packets
        """
        packets = []
        while self.size:
            if self.packet_size is None:
                if SIZEOF_BIN_SIZE < self.size:
                    # wait for more data
                    break
                header = self.get(SIZEOF_BIN_SIZE, True)
                self.packet_size = bin_to_size(header)
                if self.packet_size < 0:
                    raise SnakeMQBrokenPacket("wrong packet header")
            else:
                if self.size < self.packet_size:
                    # wait for more data
                    break
                packets.append(self.get(self.packet_size, True))
                self.packet_size = None

        return packets

############################################################################
############################################################################
dataset/ETHPy150Open dsiroky/snakemq/snakemq/packeter.py/ReceiveBuffer.get_packets/swapped operands of `<`