def gen_chunks(self, gen):
        """
        Takes a bytes generator and yields chunks of a maximum of [chunk_size]
        bytes.
        """
        for data in gen:
            if not isinstance(data, six.binary_type):
                data = data.encode('utf-8')
            size = len(data)
            if self.chunk_size < size:
                yield data
            else:
                mv = buffer(data)
                offset = 0
                while offset < size:
                    nb = min(self.chunk_size, size - offset)
                    yield mv[offset:offset + nb]
                    offset += nb
dataset/ETHPy150Open ipfs/py-ipfs-api/ipfsApi/multipart.py/BufferedGenerator.gen_chunks/swapped operands of `<`