def METHOD_NAME(boto3_session):
    """Gets the R2 credentials from the boto3 session object.
    Args:
        boto3_session: The boto3 session object.
    Returns:
        botocore.credentials.ReadOnlyCredentials object with the R2 credentials.
    """
    with _load_r2_credentials_env():
        cloudflare_credentials = boto3_session.get_credentials()
        if cloudflare_credentials is None:
            with ux_utils.print_exception_no_traceback():
                raise ValueError('Cloudflare credentials not found. Run '
                                 '`sky check` to verify credentials are '
                                 'correctly set up.')
        else:
            return cloudflare_credentials.get_frozen_credentials()