<commit_before>"""This module contains a Daemon extension that listens for messages."""

import time
import logging

LOG = logging.getLogger(__name__)

from ..base import Daemon


class MessageDaemon(Daemon):
    """This daemon provides a specialized interface over the base daemon.

    This daemon implements its own 'run()' method which enters a loop of
    polling for messages and then dispatching those messages.

    In order to implement this daemon the 'get_message()' and
    'handle_message()' methods must be defined.

    Messages daemons can be constructed with an optional 'idle_time' which is
    the amount of time to sleep/idle when 'get_message()' returns None.
    """

    # This alias for sleep is placed here to allow extensions to change the
    # idle behaviour of the loop without monkey patching the time library.
    sleep = time.sleep

    def __init__(self, pidfile, idle_time=0.1):

        self.idle_time = idle_time
<commit_msg>Fix: Missing staticmethod decorator for time.sleep<commit_after>"""This module contains a Daemon extension that listens for messages."""

import time
import logging

LOG = logging.getLogger(__name__)

from ..base import Daemon


class MessageDaemon(Daemon):
    """This daemon provides a specialized interface over the base daemon.

    This daemon implements its own 'run()' method which enters a loop of
    polling for messages and then dispatching those messages.

    In order to implement this daemon the 'get_message()' and
    'handle_message()' methods must be defined.

    Messages daemons can be constructed with an optional 'idle_time' which is
    the amount of time to sleep/idle when 'get_message()' returns None.
    """

    # This alias for sleep is placed here to allow extensions to change the
    # idle behaviour of the loop without monkey patching the time library.
    sleep = staticmethod(time.sleep)

    def __init__(self, pidfile, idle_time=0.1):

        self.idle_time = idle_time

{'fraction_non_alphanumeric': 0.06487582361885454, 'fraction_numerical': 0.0020273694880892043, 'mean_word_length': 3.7338129496402876, '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': '1653919', 'n_tokens_mistral': 528, 'n_tokens_neox': 514, 'n_words': 243}