#!/usr/bin/env python
import boto3
import random
import os
BUCKET=os.environ.get('EXPORT_S3_BUCKET_URL')
if (BUCKET != None):
    s3 = boto3.client('s3')
    with open("maze.txt", "rb") as f:
        s3.upload_fileobj(f, BUCKET, "maze"+str(random.randrange(100000))+".txt")
else:
    print("EXPORT_S3_BUCKET_URL was not set so not uploading file")

[((5, 7, 5, 45), 'os.environ.get', 'os.environ.get', ({(5, 22, 5, 44): '"""EXPORT_S3_BUCKET_URL"""'}, {}), "('EXPORT_S3_BUCKET_URL')", False, 'import os\n'), ((7, 9, 7, 27), 'boto3.client', 'boto3.client', ({(7, 22, 7, 26): '"""s3"""'}, {}), "('s3')", False, 'import boto3\n'), ((9, 48, 9, 72), 'random.randrange', 'random.randrange', ({(9, 65, 9, 71): '(100000)'}, {}), '(100000)', False, 'import random\n')]