<commit_before>from pokemongo_bot import logger
from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot.cell_workers.base_task import BaseTask


class IncubateEggs(BaseTask):
    last_km_walked = 0

    def initialize(self):
        self.ready_incubators = []
        self.used_incubators = []
        self.eggs = []
        self.km_walked = 0
        self.hatching_animation_delay = 4.20
        self.max_iv = 45.0

        self._process_config()

    def _process_config(self):
        self.longer_eggs_first = self.config.get("longer_eggs_first", True)

    def work(self):
        try:
            self._check_inventory()
        except:
            return

        if self.used_incubators and IncubateEggs.last_km_walked != self.km_walked:
            self.used_incubators.sort(key=lambda x: x.get("km"))
            km_left = self.used_incubators[0]['km']-self.km_walked
            if km_left <= 0:
                self._hatch_eggs()
            else:
                logger.log('[x] Next egg incubates in {:.2f} km'.format(km_left),'yellow')<commit_msg>Change egg hatching text (#2258)<commit_after>from pokemongo_bot import logger
from pokemongo_bot.human_behaviour import sleep
from pokemongo_bot.cell_workers.base_task import BaseTask


class IncubateEggs(BaseTask):
    last_km_walked = 0

    def initialize(self):
        self.ready_incubators = []
        self.used_incubators = []
        self.eggs = []
        self.km_walked = 0
        self.hatching_animation_delay = 4.20
        self.max_iv = 45.0

        self._process_config()

    def _process_config(self):
        self.longer_eggs_first = self.config.get("longer_eggs_first", True)

    def work(self):
        try:
            self._check_inventory()
        except:
            return

        if self.used_incubators and IncubateEggs.last_km_walked != self.km_walked:
            self.used_incubators.sort(key=lambda x: x.get("km"))
            km_left = self.used_incubators[0]['km']-self.km_walked
            if km_left <= 0:
                self._hatch_eggs()
            else:
                logger.log('[x] Current egg hatches in {:.2f} km'.format(km_left),'yellow')
{'fraction_non_alphanumeric': 0.10027726432532348, 'fraction_numerical': 0.012014787430683918, 'mean_word_length': 2.377535101404056, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '191', 'n_tokens_mistral': 750, 'n_tokens_neox': 705, 'n_words': 125}