def _perform_multipart_upload(self, bucket, key, data=None, zip=False, acl=None):
    kwargs = ({'ACL': acl} if acl else {})
    multipart_upload_dict = self.s3_client.create_multipart_upload(Bucket=bucket, Key=key, **kwargs)
    upload_id = multipart_upload_dict['UploadId']
    data = (data or (5 * short_uid()))
    data = to_bytes(data)
    upload_file_object = BytesIO(data)
    if zip:
        upload_file_object = BytesIO()
        with gzip.GzipFile(fileobj=upload_file_object, mode='w') as filestream:
            filestream.write(data)
    response = self.s3_client.upload_part(Bucket=bucket, Key=key, Body=upload_file_object, PartNumber=1, UploadId=upload_id)
    multipart_upload_parts = [{'ETag': response['ETag'], 'PartNumber': 1}]
    return self.s3_client.complete_multipart_upload(Bucket=bucket, Key=key, MultipartUpload={'Parts': multipart_upload_parts}, UploadId=upload_id)
def _perform_multipart_upload(self, bucket, key, data=None, zip=False, acl=None):
    kwargs = ({'ACL': acl} if acl else {})
    multipart_upload_dict = self.s3_client.create_multipart_upload(Bucket=bucket, Key=key, **kwargs)
    upload_id = multipart_upload_dict['UploadId']
    data = (data or (5 * short_uid()))
    data = to_bytes(data)
    upload_file_object = BytesIO(data)
    if zip:
        upload_file_object = BytesIO()
        with gzip.GzipFile(fileobj=upload_file_object, mode='w') as filestream:
            filestream.write(data)
    response = self.s3_client.upload_part(Bucket=bucket, Key=key, Body=upload_file_object, PartNumber=1, UploadId=upload_id)
    multipart_upload_parts = [{'ETag': response['ETag'], 'PartNumber': 1}]
    return self.s3_client.complete_multipart_upload(Bucket=bucket, Key=key, MultipartUpload={'Parts': multipart_upload_parts}, UploadId=upload_id)