<commit_before>import time
import logging
import thread
import asyncore
from servicebus.command import cmd

DIDA_TIMEOUT = 60


class PingWatcher:
    def __init__(self, receiver):
        self.receiver = receiver

    def do_watch(self):
        ip = self.receiver.host
        while True:
            ret = self.ping(ip)
            if not ret and self.receiver.connected:
                self.receiver.connected = False
                logging.info("Ping Error!")
                return
            elif not self.receiver.connected
                logging.info("Message receiver exited, PingWatcher out.")
                return
            time.sleep(DIDA_TIMEOUT)<commit_msg>Fix grama bug<commit_after>import time
import logging
import thread
import asyncore
from servicebus.command import cmd

DIDA_TIMEOUT = 60


class PingWatcher:
    def __init__(self, receiver):
        self.receiver = receiver

    def do_watch(self):
        ip = self.receiver.host
        while True:
            ret = self.ping(ip)
            if not ret and self.receiver.connected:
                self.receiver.connected = False
                logging.info("Ping Error!")
                return
            elif not self.receiver.connected:
                logging.info("Message receiver exited, PingWatcher out.")
                return
            time.sleep(DIDA_TIMEOUT)
{'fraction_non_alphanumeric': 0.06980161645848641, 'fraction_numerical': 0.0029390154298310064, 'mean_word_length': 1.9164882226980728, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3060939', 'n_tokens_mistral': 375, 'n_tokens_neox': 355, 'n_words': 99}