'Initializes the worker.
:param bot: The bot instance.
:type bot: PokemonGoBot
:param config: The task configuration.
:type config: dict'

def __init__(self, bot, config):

    super(UpdateLiveStats, self).__init__(bot, config)
    self.next_update = None
    self.min_interval = int(self.config.get('min_interval', 120))
    self.displayed_stats = self.config.get('stats', [])
    self.terminal_log = bool(self.config.get('terminal_log', False))
    self.terminal_title = bool(self.config.get('terminal_title', True))
    self.bot.event_manager.register_event('log_stats', parameters=('stats', 'stats_raw'))
    self.xp_per_level = None
    xpfile = 'data/xp_per_level.json'
    try:
        with open(xpfile, 'rb') as data:
            self.xp_per_level = json.load(data)
    except (ValueError, IOError):
        self.emit_event('log_stats', level='info', formatted='Unable    to    read    XP    level    file')
        self.xp_per_level = [[1, 0, 0], [2, 1000, 1000], [3, 2000, 3000], [4, 3000, 6000], [5, 4000, 10000], [6, 5000, 15000], [7, 6000, 21000], [8, 7000, 28000], [9, 8000, 36000], [10, 9000, 45000], [11, 10000, 55000], [12, 10000, 65000], [13, 10000, 75000], [14, 10000, 85000], [15, 15000, 100000], [16, 20000, 120000], [17, 20000, 140000], [18, 20000, 160000], [19, 25000, 185000], [20, 25000, 210000], [21, 50000, 260000], [22, 75000, 335000], [23, 100000, 435000], [24, 125000, 560000], [25, 150000, 710000], [26, 190000, 900000], [27, 200000, 1100000], [28, 250000, 1350000], [29, 300000, 1650000], [30, 350000, 2000000], [31, 500000, 2500000], [32, 500000, 3000000], [33, 750000, 3750000], [34, 1000000, 4750000], [35, 1250000, 6000000], [36, 1500000, 7500000], [37, 2000000, 9500000], [38, 2500000, 12000000], [39, 3000000, 15000000], [40, 5000000, 20000000]]
