<commit_before>import socket
import json
from ConfigParser import SafeConfigParser

class Client:
    def __init__(self):
        self.initialize_configs()
        self.create_socket()
        self.connect()

    def initialize_configs(self):
        config = SafeConfigParser()
        config.read([
            os.path.join(os.path.dirname(__file__), 'default.conf'),
            # any other files to overwrite defaults here
        ])

        self.host=config.get('client', 'server_host'),
        self.port=config.getint('client', 'server_port'),
        self.protocol=config.get('client', 'protocol'),
        
        # set the protocol to follow
        self.protocol = configs.get('protocol', 'TCP') # defaults to reliable one - TCP
        if self.protocol not in ['TCP', 'UDP']:
            self.protocol = 'TCP' 


    def create_socket(self):
        if self.protocol == 'TCP':
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        elif self.protocol == 'UDP':
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        else:
            self.socket = socket.socket()
        
    def connect(self):
        if self.protocol == 'TCP':
            print 'connecting to the server %s' % (self.host)
            self.socket.connect((self.host, self.port))<commit_msg>minor fixes which were left out<commit_after>import socket
import json
import os
from ConfigParser import SafeConfigParser

class Client:
    def __init__(self):
        self.initialize_configs()
        self.create_socket()
        self.connect()

    def initialize_configs(self):
        config = SafeConfigParser()
        config.read([
            os.path.join(os.path.dirname(__file__), 'default.conf'),
            # any other files to overwrite defaults here
        ])

        self.host=config.get('client', 'server_host'),
        self.port=config.getint('client', 'server_port'),
        self.protocol=config.get('client', 'protocol'),
        
        # set the protocol to follow
        self.protocol = config.get('protocol', 'TCP') # defaults to reliable one - TCP
        if self.protocol not in ['TCP', 'UDP']:
            self.protocol = 'TCP' 


    def create_socket(self):
        if self.protocol == 'TCP':
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        elif self.protocol == 'UDP':
            self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        else:
            self.socket = socket.socket()
        
    def connect(self):
        if self.protocol == 'TCP':
            print 'connecting to the server %s' % (self.host)
            self.socket.connect((self.host, self.port))
{'fraction_non_alphanumeric': 0.12049088880624767, 'fraction_numerical': 0.0, 'mean_word_length': 2.3046683046683047, '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': '2812996', 'n_tokens_mistral': 764, 'n_tokens_neox': 745, 'n_words': 180}