<commit_before>import socket
import mpd
import ssl
import os

#Load config file from config.py
exec(open(os.path.join(os.path.dirname(__file__), "configs" + os.sep + "config.py"), "r").read())

#Define connection class
class ConnectionMan:
    def __init__(self):
	#connect to mpd server
        self.mpc = mpd.MPDClient()
        self.mpc.connect(MPD_HOST, MPD_PORT)

	#If SSL is enabled use ssl
        if(SSL):
            self.s = ssl.wrap_socket(socket.socket( ))
        else:
            self.s = socket.socket( )
        self.s.connect((HOST, PORT))
        self.s.send("USER " + NICK + " " + NICK + " " + NICK + " :" + NICK + "\n")
        self.s.send("NICK " + NICK + "\r\n")
        self.s.send("JOIN " + HOME_CHANNEL + "\r\n")

        print "*** Connecting... ***"
        while 1:
            line = self.s.recv(2048)
            line = line.strip("\r\n")
            if("End of /NAMES list." in line):
	        print "\n*** Connected! ***\n"
	        break
            else:
	        print line

	#Define private message function<commit_msg>Fixed inconsistent connection issues on startup<commit_after>import socket
import mpd
import ssl
import os

#Load config file from config.py
exec(open(os.path.join(os.path.dirname(__file__), "configs" + os.sep + "config.py"), "r").read())

#Define connection class
class ConnectionMan:
    def __init__(self):
	#connect to mpd server
        self.mpc = mpd.MPDClient()
        self.mpc.connect(MPD_HOST, MPD_PORT)

	#If SSL is enabled use ssl
        if(SSL):
            self.s = ssl.wrap_socket(socket.socket( ))
        else:
            self.s = socket.socket( )
        self.s.connect((HOST, PORT))
        self.s.send("USER " + NICK + " " + NICK + " " + NICK + " :" + NICK + "\n")
        self.s.send("NICK " + NICK + "\r\n")

        print "*** Connecting... ***"

        while 1:
            line = self.s.recv(2048)
            line = line.strip("\r\n")
            if("End of /MOTD command." in line):
	        break
            else:
	        print line

        self.s.send("JOIN " + HOME_CHANNEL + "\r\n")

        while 1:
            line = self.s.recv(2048)
            line = line.strip("\r\n")
            if("End of /NAMES list." in line):
	        print "\n*** Connected! ***\n"
	        break
            else:
	        print line

	#Define private message function
{'fraction_non_alphanumeric': 0.15108834827144688, 'fraction_numerical': 0.006402048655569782, 'mean_word_length': 1.9081885856079404, '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': '3563362', 'n_tokens_mistral': 801, 'n_tokens_neox': 767, 'n_words': 190}