<commit_before>#!/usr/bin/python
import sys
import zmq
import time

# Connection to our subscriber socket
contextS = zmq.Context()
subscriber = contextS.socket(zmq.SUB)
subscriber.setsockopt(zmq.SUBSCRIBE, "")
poller = zmq.Poller()
poller.register(subscriber, zmq.POLLIN)
subscriber.connect('tcp://localhost:5582')

# Connection to our publisher socket
contextP = zmq.Context()
publisher = contextP.socket(zmq.PUB)
publisher.connect("tcp://localhost:5581")
publisher.sndhwm = 1100000


class SocketClass():

    def subscriber(self):
	
	socks = dict(poller.poll(0))
        if socks:
            if socks.get(subscriber) == zmq.POLLIN:
                 string = subscriber.recv(zmq.NOBLOCK)
	         return string

            else:
                 print "error:message timeout"
    	
    	
    def publisher(self, bat):
	publisher.send_string('{}'.format(bat),zmq.NOBLOCK)
	time.sleep(1)



<commit_msg>Update SocketBatteryFile.py<commit_after>#!/usr/bin/python
import sys
import zmq
import time

# Connection to our subscriber socket
contextS = zmq.Context()
subscriber = contextS.socket(zmq.SUB)
subscriber.setsockopt(zmq.SUBSCRIBE, "")
poller = zmq.Poller()
poller.register(subscriber, zmq.POLLIN)
subscriber.connect('tcp://localhost:5582')

# Connection to our publisher socket
contextP = zmq.Context()
publisher = contextP.socket(zmq.PUB)
publisher.connect("tcp://localhost:5581")
publisher.sndhwm = 1100000


class SocketClass():

    def subscriber(self):
	socks = dict(poller.poll(0))
        if socks:
            if socks.get(subscriber) == zmq.POLLIN:
                 string = subscriber.recv(zmq.NOBLOCK)
	         return string
            else:
                 print "error:message timeout"
    		
    def publisher(self, bat):
	publisher.send_string('{}'.format(bat),zmq.NOBLOCK)
	time.sleep(1)
{'fraction_non_alphanumeric': 0.12403528114663727, 'fraction_numerical': 0.018743109151047408, 'mean_word_length': 3.4160583941605838, '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': '114834', 'n_tokens_mistral': 633, 'n_tokens_neox': 594, 'n_words': 117}