def can_list(access_key, secret_key):
    # Bail out early as boto does not handle getting
    # Called with (None, None)
    if not (access_key and secret_key):
        return False

    try:
        connect_s3(access_key, secret_key).get_all_buckets()
    except exception.S3ResponseError:
        return False
    return True
Return whether or not a user can list
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/addons/s3/utils.py/can_list