def _make_finalize_task(self, pickled):
        payload = BytesIO()
        msg_writer = wire.PackedMessageWriter(payload)
        msg_writer.string('agg-finalize')
        msg_writer.string(pickled)

        # Create memory map of the appropriate size
        path = 'task_%s' % guid()
        size = payload.tell()
        offset = 0
        mm = SharedMmap(path, size, create=True)
        self.paths_to_delete.append(path)

        mm.write(payload.getvalue())

        task = IbisTaskMessage(self.lock.semaphore_id, path, offset, size)

        return task, mm
dataset/ETHPy150Open cloudera/ibis/ibis/tests/test_tasks.py/TestAggregateTasks._make_finalize_task/original