def _get_or_create_s3_bucket(s3, name):
exists = True<EOL>try:<EOL><INDENT>s3.meta.client.head_bucket(Bucket=name)<EOL><DEDENT>except botocore.exceptions.ClientError as e:<EOL><INDENT>error_code = int(e.response["<STR_LIT>"]["<STR_LIT>"])<EOL>if error_code == <NUM_LIT>:<EOL><INDENT>exists = False<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>if not exists:<EOL><INDENT>s3.create_bucket(Bucket=name)<EOL><DEDENT>return s3.Bucket(name)<EOL>
Get an S3 bucket resource after making sure it exists