def open_s3(bucket):
conn = boto.connect_s3(options.paved.s3.access_id, options.paved.s3.secret)<EOL>try:<EOL><INDENT>bucket = conn.get_bucket(bucket)<EOL><DEDENT>except boto.exception.S3ResponseError:<EOL><INDENT>bucket = conn.create_bucket(bucket)<EOL><DEDENT>return bucket<EOL>
Opens connection to S3 returning bucket and key