<commit_before>from SocketServer import ThreadingTCPServer, StreamRequestHandler


class dataServer():

    def __init__(self, serv_host, serv_port):
        self.host = serv_host
        self.port = serv_port
        self.addr = (serv_host, serv_port)
        self.server = ThreadingTCPServer(self.addr, RequestHandler)
        self.server.serve_forever()


class RequestHandler(StreamRequestHandler):

    def handle(self):
        while True:
            data = raw_input()
            if not data:
                break
            self.request.send(data)

if __name__ == "__main__":
    print 'server is running....'
    data_server = dataServer('127.0.0.1', 1234)<commit_msg>Only maintain server info and client list in class dataServer - Code clean up, remove SocketServer module - Maintian IP, Port, ListenPool and Client list in class dataServer<commit_after>import socket
import threading
import time


class dataServer(threading.Thread):

    def __init__(self, serv_host, serv_port, listen_pool):
        super(dataServer, self).__init__()
        self.host = serv_host
        self.port = serv_port
        self.addr = (serv_host, serv_port)
        self.listen_pool = listen_pool
        self.client_list = []

    def run(self):
        server = socket.socket()
        server.bind(self.addr)
        server.listen(self.listen_pool)
        while True:
            conn, addr = server.accept()
            self.client_list.append((conn, addr))
            print 'Client {} connected.'.format(addr)


if __name__ == "__main__":
    print 'server is running....'
    data_server = dataServer('127.0.0.1', 1234, 10)
    data_server.daemon = True
    data_server.start()
    while True:
        print data_server.client_list
        time.sleep(1)
{'fraction_non_alphanumeric': 0.09789413773477519, 'fraction_numerical': 0.01309049516220831, 'mean_word_length': 2.624742268041237, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '7525071', 'n_tokens_mistral': 529, 'n_tokens_neox': 510, 'n_words': 129}