def run(self):
        if self.load_exported_image:
            if len(self.workflow.exported_image_sequence) == 0:
                raise RuntimeError('load_exported_image used, but no exported image')
            image = self.workflow.exported_image_sequence[-1].get('path')
            self.log.info('preparing to compress image %s', image)
            with open(image, 'rb') as image_stream:
                outfile = self._compress_image_stream(image_stream)
        else:
            image = self.workflow.image
            self.log.info('fetching image %s from docker', image)
            with self.tasker.d.get_image(image) as image_stream:
                outfile = self._compress_image_stream(image_stream)
        metadata = get_exported_image_metadata(outfile)

        if self.uncompressed_size != 0:
            metadata['uncompressed_size'] = self.uncompressed_size
            savings = metadata['size'] / float(metadata['uncompressed_size']) - 1
            self.log.debug('uncompressed: %s, compressed: %s, ratio: %.2f %% saved',
                           human_size(metadata['uncompressed_size']),
                           human_size(metadata['size']),
                           100*savings)

        self.workflow.exported_image_sequence.append(metadata)
        self.log.info('compressed image is available as %s', outfile)
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/plugins/post_compress.py/CompressPlugin.run/swapped operands of `-`