def get_file_multipart(self, dealer):
        while self.offset < self.metadata.size:
            if self._stop.is_set():
                raise AbortOperation()

            dealer.send_multipart((
                GET_CHUNK,
                str(self.fid).encode(),
                str(self.offset).encode(),
                str(self.chunk_size).encode()
            ))
            resp = dealer.recv_multipart()

            if len(resp) < 2 or resp[0] == ERROR:
                raise AbortOperation()

            chunk = resp[1]

            if not chunk or len(chunk) == 0:
                raise AbortOperation()

            self.call('upload_chunk', self.metadata, self.offset, chunk)

            self.offset += len(chunk)
            self.escalator.put(self.transfer_key, self.offset)
dataset/ETHPy150Open onitu/onitu/onitu/plug/workers.py/TransferWorker.get_file_multipart/original