def compress_and_upload(self, template, paths, compress, ext):
        bucket = s3_bucket()
        name = '%s/%s.%s' % (
            conf.SIMPLESTATIC_COMPRESSED_DIR,
            hash_for_paths(paths),
            ext,
        )
        key = bucket.get_key(name)
        if key is None:
            locked_print('Compressing %s from %s' % (ext, template))
            compressed = compress(paths)
            locked_print('Uploading %s from %s' % (name, template))
            key = bucket.new_key(name)
            set_content_type(key)
            key.set_contents_from_string(compressed, policy='public-read',
                replace=True)
dataset/ETHPy150Open ericflo/django-simplestatic/simplestatic/management/commands/static_sync.py/Command.compress_and_upload/original