def s3_bucket_and_key(s3_uri, require_prefix=False):
    """
    Return the bucket and key name as a two-element list, key here could be
    file or folder under the bucket
    """
    prefix = "s3://"
    if require_prefix:
        assert s3_uri.startswith(prefix), "The path must start with s3://"
    elif not s3_uri.startswith(prefix):
        prefix = ""

    return s3_uri[len(prefix) :].split("/", 1)