def get_rank(raw):
    """Return the rank of the player."""
    display_rank = None

    prefix = raw.get('prefix')
    rank = raw.get('rank')
    playerRank = raw.get('playerRank')

    if prefix:
        return prefix
    elif rank:
        return rank.replace('_', ' ')
    else:
        return playerRank.replace('_', ' ')