<commit_before>#This is a unit test script. It should be called outside of the program.
import os
import sys
import pdb
import PluginBot
import threading
import gui
from time import sleep

class WorkerThread(threading.Thread):
	bot = None

	def __init__(self):
		super().__init__()
		self.bot = PluginBot.PluginBot()
		
	def run(self):
		self.bot.run()

	def stopBot(self):
		self.bot.quit()


def main(isTest):
	if (isTest == 0):
		bot = PluginBot.PluginBot()
		bot.connect()
		bot.userInput.join()
		bot.join()
	elif (isTest == 1):
		worker = WorkerThread()
		worker.start()
		print("Sleeping for 3 seconds.")
		sleep(2)
		print("Test reloading plugin.")
		worker.bot.reloadAll()
		print("Sleeping for 2 seconds.")
		sleep(1)
		worker.stopBot()
		print("Success!")
		sleep(1)
	elif (isTest == 2):
		myGUI = gui.GUI()
		myGUI.run()

	
def test():
	value = 0
	for i in range(len(sys.argv)):
		try:
			value = int(sys.argv[i])
		except ValueError:
			value = 0
	main(value)

if (__name__ == "__main__"):
	#pdb.run("test()")
	test()<commit_msg>Adding some notes.<commit_after>#This is a unit test script. It should be called outside of the program.

#Default: GUI (parameter value = 0)

#GUI           (Value: 2)     : User-friendly IRC bot client. Simple and minimalistic.
#UNIT-TEST     (Value: 1)     : This is only for unit testing the bot client.
#COMMANDLINE   (Value: 0)     : This is the bare-bone version of the IRC bot client.

#Usage: $> python3 start.py [VALUE]
#Definition:
#	[VALUE]: The parameter value given above.


import os
import sys
import pdb
import PluginBot
import threading
import gui
from time import sleep

class WorkerThread(threading.Thread):
	bot = None

	def __init__(self):
		super().__init__()
		self.bot = PluginBot.PluginBot()
		
	def run(self):
		self.bot.run()

	def stopBot(self):
		self.bot.quit()


def main(isTest):
	if (isTest == 0):
		bot = PluginBot.PluginBot()
		bot.connect()
		bot.userInput.join()
		bot.join()
	elif (isTest == 1):
		worker = WorkerThread()
		worker.start()
		print("Sleeping for 3 seconds.")
		sleep(2)
		print("Test reloading plugin.")
		worker.bot.reloadAll()
		print("Sleeping for 2 seconds.")
		sleep(1)
		worker.stopBot()
		print("Success!")
		sleep(1)
	elif (isTest == 2):
		myGUI = gui.GUI()
		myGUI.run()

	
def test():
	value = 2
	for i in range(len(sys.argv)):
		try:
			value = int(sys.argv[i])
		except ValueError:
			value = 2
	main(value)

if (__name__ == "__main__"):
	test()
{'fraction_non_alphanumeric': 0.13942111699959234, 'fraction_numerical': 0.010191602119853241, 'mean_word_length': 3.5613382899628254, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6656113', 'n_tokens_mistral': 965, 'n_tokens_neox': 868, 'n_words': 261}