def _album_is_reviewed(album, user_key):
    """Check if an album has been reviewed.

    Args:
      album: An Album entity
      user_key: A stringified user key, or None.

    Returns:
      If user_key is None, returns True if and only if the album has
        any reviews at all.
      If user_key is not None, returns True if and only if the album
        has been reviewed by the specified user.
    """
    if user_key is None or user_key == "":
        return len(album.reviews) > 0
    for review in album.reviews:
        if str(review.author.key()) == user_key:
            return True
    return False