<commit_before>#!/usr/bin/python
import socket               # Import socket module

s = socket.socket()         # Create a socket object
host = socket.gethostname() # Get local machine name
port = 5000                 # Reserve a port for your service.
s.bind((host, port))        # Bind to the port

s.listen(5)                 # Now wait for client connection.
print 'server running on port {0}'.format(port)
while True:
   c, addr = s.accept()     # Establish connection with client.
   print 'Got connection from', addr
   while True:
        print 'enter your message:'
        msg = raw_input()
        if msg == 'bye!':
            print msg
            c.send(msg)
            break
        else:
            c.send(msg)
   print 'waiting for another client'

   c.close()                # Close the connection<commit_msg>change server into object orientated class<commit_after>#!/usr/bin/python
import socket               # Import socket module
class Server:
    def __init__(self):
        self.s = socket.socket()         # Create a socket object
        self.host = socket.gethostname() # Get local machine name
        self.port = 5000                 # Reserve a port for your service.
        self.s.bind((host, port))        # Bind to the port
        self.s.listen(5)                 # Now wait for client connection.
        print 'server running on port {0}'.format(port)

    def serve(self):
        while True:
            c, addr = s.accept()     # Establish connection with client.
            print 'Got connection from', addr
            while True:
                print 'enter your message:'
                msg = raw_input()
                if msg == 'bye!':
                print msg
                c.send(msg)
                break
                    else:
                    c.send(msg)
                print 'waiting for another client'

                c.close()                # Close the connection
{'fraction_non_alphanumeric': 0.08664259927797834, 'fraction_numerical': 0.006188757091284167, 'mean_word_length': 1.5227568270481144, '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': '4835726', 'n_tokens_mistral': 506, 'n_tokens_neox': 482, 'n_words': 178}