<commit_before>import pika
import uuid
import time
import json
import threading
import platform
import urllib2
import mq_handler
import actions

# Create a global channel variable to hold our channel object in
mq_handle = None

settings_dict = {'speed': 5}
settings_change = False

def upload(data):
	global settings_dict
	if data == 'true':
		print settings_dict
	return

def settings(data):
	global settings_dict
	global settings_change
	data = json.loads(data)
	settings_dict.update(data)
	settings_change = True
	print settings_change
	return

def shutdown(data):
	global run
	global connection
	global mq_handle
	if data == 'true':
		print "Shutdown received"
		run = False
		mq_handle.run = False
		mq_handle.connection.close()
	return
	
def reconnect(data):
	global connection
	global mq_handle
	if data == 'true':
		print "Reconnect received"
		mq_handle.connection.close()
	return

actionsd = {'shutdown': shutdown,
		   'reconnect': reconnect,
		   'settings': settings,
		   'upload': upload,
}

def monitor_thread():
	global settings_dict
	global settings_change
	while True:
		print ".",
		if actions.settings_change:
			print settings_dict
			actions.settings_change = False
		time.sleep(1)
		
def main():
	global mq_handle
	global actionsd
	
	monitor = threading.Thread(target = monitor_thread)
	monitor.daemon = True
	monitor.start()
	
	mq_handle = mq_handler.mq_handler(actions.actions, 'device', '123')
	mq_handle.start()
	actions.init_actions(settings_dict, mq_handle)
	
	while mq_handle.run:
		pass
	print "Shutting down..."
	time.sleep(5)

if __name__ == "__main__":
	try:<commit_msg>Removed actions from main file<commit_after>import pika
import uuid
import time
import json
import threading
import platform
import urllib2
import mq_handler
import actions

# Create a global channel variable to hold our channel object in
mq_handle = None

settings_dict = {'speed': 5}

def monitor_thread():
	global settings_dict
	while True:
		print ".",
		if actions.settings_change:
			print settings_dict
			actions.settings_change = False
		time.sleep(1)
		
def main():
	global mq_handle
	global actionsd
	
	monitor = threading.Thread(target = monitor_thread)
	monitor.daemon = True
	monitor.start()
	
	mq_handle = mq_handler.mq_handler(actions.actions, 'device', '123')
	mq_handle.start()
	actions.init_actions(settings_dict, mq_handle)
	
	while mq_handle.run:
		pass
	print "Shutting down..."
	time.sleep(5)

if __name__ == "__main__":
	try:
{'fraction_non_alphanumeric': 0.08801955990220049, 'fraction_numerical': 0.0057049714751426246, 'mean_word_length': 4.6307339449541285, 'pattern_counts': {'":': 2, '<': 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': '5952475', 'n_tokens_mistral': 844, 'n_tokens_neox': 791, 'n_words': 230}