<commit_before>import json
import logging
import sys
import time
import os

from reflowrestclient.processing.daemon import Daemon
from reflowrestclient import utils
from models import ProcessRequest
from processes import PROCESS_LIST, dispatch_process

WORKER_CONF = '/etc/reflow_worker.conf'
WORKER_LOG = '/var/log/reflow_worker.log'
DEFAULT_SLEEP = 5  # in seconds


class Worker(Daemon):
    def __init__(self):
        # a Worker can have only one host
        self.host = None
        self.name = None
        self.token = <PASSWORD>
        self.genuine = False
        self.assigned_pr = None
        self.errors = list()

        # default sleep time between checking the server (in seconds)
        self.sleep = DEFAULT_SLEEP

        # setup logging
        try:
            logging.basicConfig(
                filename=WORKER_LOG,
                filemode='a',
                level=logging.DEBUG)
        except IOError, e:
            message = "Failed to setup logging to file: %s\n" + \
                "Do you have permission to write to this file?"
            sys.stderr.write(message % WORKER_LOG)
            sys.stderr.write(e.message)
            sys.exit(1)

        # All worker configs are stored in /etc/reflow-worker.conf
        try:<commit_msg>change default sleep to 15 seconds<commit_after>import json
import logging
import sys
import time
import os

from reflowrestclient.processing.daemon import Daemon
from reflowrestclient import utils
from models import ProcessRequest
from processes import PROCESS_LIST, dispatch_process

WORKER_CONF = '/etc/reflow_worker.conf'
WORKER_LOG = '/var/log/reflow_worker.log'
DEFAULT_SLEEP = 15  # in seconds


class Worker(Daemon):
    def __init__(self):
        # a Worker can have only one host
        self.host = None
        self.name = None
        self.token = None
        self.genuine = False
        self.assigned_pr = None
        self.errors = list()

        # default sleep time between checking the server (in seconds)
        self.sleep = DEFAULT_SLEEP

        # setup logging
        try:
            logging.basicConfig(
                filename=WORKER_LOG,
                filemode='a',
                level=logging.DEBUG)
        except IOError, e:
            message = "Failed to setup logging to file: %s\n" + \
                "Do you have permission to write to this file?"
            sys.stderr.write(message % WORKER_LOG)
            sys.stderr.write(e.message)
            sys.exit(1)

        # All worker configs are stored in /etc/reflow-worker.conf
        try:
{'fraction_non_alphanumeric': 0.07254290171606864, 'fraction_numerical': 0.002730109204368175, 'mean_word_length': 2.151105651105651, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2122413', 'n_tokens_mistral': 730, 'n_tokens_neox': 708, 'n_words': 220}