<commit_before>#!/usr/bin/python
#License#
#bitHopper by <NAME> is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
#Based on a work at github.com.

import traceback

import time
import eventlet
from eventlet.green import time, threading

from peak.util import plugins

class RPCWorkLog():
    def __init__(self, bitHopper):
        self.bitHopper = bitHopper
        hook = plugins.Hook('work.rpc.request')
        hook.register(self.rpcWorkReport)
                            
    def rpcWorkReport(self, rpc_request, data, server):
        if self.bitHopper.options.debug:
            self.bitHopper.log_msg('RPC request ' + str(data) + " submitted to " + server)
        elif data == []:
            self.bitHopper.log_msg('RPC request [' + rpc_request['method'] + "] submitted to " + server)
        else:
            self.bitHopper.log_msg('RPC request [' + data[0][155:163] + "] submitted to " + server)<commit_msg>fixed rpcworklog.py<commit_after>#!/usr/bin/python
#License#
#bitHopper by <NAME> is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
#Based on a work at github.com.

import traceback, logging, eventlet
from eventlet.green import time, threading

from peak.util import plugins

class RPCWorkLog():
    def __init__(self, bitHopper):
        self.bitHopper = bitHopper
        hook = plugins.Hook('work.rpc.request')
        hook.register(self.rpcWorkReport)
                            
    def rpcWorkReport(self, rpc_request, data, server):
        if self.bitHopper.options.debug:
            logging.info('RPC request ' + str(data) + " submitted to " + server)
        elif data == []:
            logging.info('RPC request [' + rpc_request['method'] + "] submitted to " + server)
        else:
            logging.info('RPC request [' + data[0][155:163] + "] submitted to " + server)
{'fraction_non_alphanumeric': 0.11380400421496312, 'fraction_numerical': 0.009483667017913594, 'mean_word_length': 2.8834355828220857, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4870227', 'n_tokens_mistral': 597, 'n_tokens_neox': 564, 'n_words': 146}