'Generates a stats string with the given player stats according to the configuration.
:return: A string containing human-readable stats, ready to be displayed.
:rtype: string'

def _get_stats_line(self, player_stats):

    if (player_stats is None):
        return ''
    available_stats = {'login': player_stats['login'], 'username': player_stats['username'], 'uptime': 'Uptime    :    {}'.format(player_stats['uptime']), 'km_walked': '{:,.2f}km    walked'.format(player_stats['km_walked']), 'level': 'Level    {}'.format(player_stats['level']), 'level_completion': '{:,}    /    {:,}    XP    ({}%)'.format(player_stats['current_level_xp'], player_stats['whole_level_xp'], player_stats['level_completion_percentage']), 'level_stats': 'Level    {}    ({:,}    /    {:,},    {}%)'.format(player_stats['level'], player_stats['current_level_xp'], player_stats['whole_level_xp'], player_stats['level_completion_percentage']), 'xp_per_hour': '{:,}    XP/h'.format(player_stats['xp_per_hour']), 'xp_earned': '+{:,}    XP'.format(player_stats['xp_earned']), 'time_to_level': 'TTL:    {}'.format(player_stats['time_to_level']), 'stops_visited': 'Visited    {:,}    stops'.format(player_stats['stops_visited']), 'pokemon_encountered': 'Encountered    {:,}    pokemon'.format(player_stats['pokemon_encountered']), 'pokemon_caught': 'Caught    {:,}    pokemon'.format(player_stats['pokemon_caught']), 'captures_per_hour': '{:,}    pokemon/h'.format(player_stats['captures_per_hour']), 'pokemon_released': 'Released    {:,}    pokemon'.format(player_stats['pokemon_released']), 'pokemon_evolved': 'Evolved    {:,}    pokemon'.format(player_stats['pokemon_evolved']), 'pokemon_unseen': 'Encountered    {}    new    pokemon'.format(player_stats['pokemon_unseen']), 'pokemon_stats': 'Encountered    {:,}    pokemon,    {:,}    caught,    {:,}    released,    {:,}    evolved,    {}    never    seen    before'.format(player_stats['pokemon_encountered'], player_stats['pokemon_caught'], player_stats['pokemon_released'], player_stats['pokemon_evolved'], player_stats['pokemon_unseen']), 'pokeballs_thrown': 'Threw    {:,}    pokeballs'.format(player_stats['pokeballs_thrown']), 'stardust_earned': 'Earned    {:,}    Stardust'.format(player_stats['stardust_earned']), 'stardust_per_hour': '{:,}    Stardust/h'.format(player_stats['stardust_per_hour']), 'total_stardust': 'Total    Stardust:    {:,}'.format(player_stats['total_stardust']), 'highest_cp_pokemon': 'Highest    CP    pokemon    :    {}'.format(player_stats['highest_cp_pokemon']), 'most_perfect_pokemon': 'Most    perfect    pokemon    :    {}'.format(player_stats['most_perfect_pokemon']), 'location': 'Location    :    ({},    {})'.format(*player_stats['location']), 'next_egg_hatching': 'Next    egg    hatches    in    :    {:.2f}    km'.format(player_stats['next_egg_hatching']), 'hatched_eggs': 'Hatched    {}    eggs.'.format(player_stats['hatched_eggs'])}
    def get_stat(stat):
        "\n                                                Fetches    a    stat    string    from    the    available    stats    dictionary.\n                                                :param    stat:    The    stat    name.\n                                                :type    stat:    string\n                                                :return:    The    generated    stat    string.\n                                                :rtype:    string\n                                                :raise:    ConfigException:    When    the    provided    stat    string    isn't    in    the    available    stats\n                                                dictionary.\n                                                "
        if (stat not in available_stats):
            raise ConfigException("stat    '{}'    isn't    available    for    displaying".format(stat))
        return available_stats[stat]
    line = '    |    '.join(map(get_stat, self.displayed_stats))
    return line
