def batch_delete_s3_objects(<EOL>keys,<EOL>aws_bucket_name,<EOL>chunk_size=<NUM_LIT:100>,<EOL>s3_client=None<EOL>):
if s3_client is None:<EOL><INDENT>s3_client, s3_resource = get_s3_client()<EOL><DEDENT>key_chunks = []<EOL>for i in range(<NUM_LIT:0>, len(keys), chunk_size):<EOL><INDENT>chunk = []<EOL>for key in (list(keys)[i:i+<NUM_LIT:100>]):<EOL><INDENT>chunk.append({'<STR_LIT>': key})<EOL><DEDENT>key_chunks.append(chunk)<EOL><DEDENT>for chunk in key_chunks:<EOL><INDENT>s3_client.delete_objects(<EOL>Bucket=aws_bucket_name,<EOL>Delete={'<STR_LIT>': chunk}<EOL>)<EOL><DEDENT>
Utility method that batch deletes objects in given bucket.