<commit_before>from types import *
from sqlite3 import Row
import random
from datetime import datetime
import common
import usermanager
import logmanager
import activitymanager

def run_tests():
	try:
		assert usermanager.create_users_if_dne()
	except AssertionError as e:
		print("assert usermanager.create_users_if_dne() failed")
	except Exception as e:
		print(e)
	
	# Generates random username
	random.seed(datetime.now().microsecond)
	username = random.randint(0, 10000)

	try:
		assert usermanager.insert_user(username)
	except AssertionError as e:
		print("assert usermanager.insert_user() failed")
	except Exception as e:
		print(e)

	try:
		assert usermanager.user_exists(username)
	except AssertionError as e:
		print("assert usermanager.user_exists('{}') failed".format(username))
	except Exception as e:
		print(e)
	
	try:
		assert not usermanager.user_exists("blablabla")
	except AssertionError as e:
		print("assert not usermanager.user_exists('blablabla') failed")
	except Exception as e:
		print(e)

	try:
		assert not usermanager.wc_info_filled(username)
	except AssertionError as e:
		print("assert not usermanager.wc_info_filled('{}') failed".format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.update_wc_info(username, "daily", "11111", "3590sxeioel34ios34109")
	except AssertionError as e:
		print('assert usermanager.update_wc_info("{}", "daily", "11111", "3590sxeioel34ios34109") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.wc_info_filled(username)
	except AssertionError as e:
		print('assert usermanager.wc_info_filled("{}") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert not usermanager.fb_info_filled(username)
	except AssertionError as e:
		print('assert not usermanager.fb_info_filled("{}") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.update_fb_info(username, "sl35902nej3390fh493wj394hlhk039")
	except AssertionError as e:
		print('assert usermanager.update_fb_info("{}", "sl35902nej3390fh493wj394hlhk039") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.fb_info_filled(username)
	except AssertionError as e:
		print('assert usermanager.fb_info_filled("{}") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert not usermanager.get_users() is NoneType
	except AssertionError as e:
		print('assert not usermanager.get_users() is NoneType failed')
	except Exception as e:
		print(e)

	try:
		assert not len(usermanager.get_users()) == 0
	except AssertionError as e:
		print('assert not len(usermanager.get_users()) == 0 failed')
	except Exception as e:
		print(e)

	user = usermanager.get_user(username)
	
	try:
		assert isinstance(user, Row)
	except AssertionError as e:
		print('assert isinstance(user, Row) failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["id"] is NoneType
	except AssertionError as e:
		print('assert not user["id"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["username"] is NoneType
	except AssertionError as e:
		print('assert not user["username"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["registered_on"] is NoneType
	except AssertionError as e:
		print('assert not user["registered_on"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["goal_period"] is NoneType
	except AssertionError as e:
		print('assert not user["goal_period"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["wc_id"] is NoneType
	except AssertionError as e:
		print('assert not user["wc_id"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["wc_token"] is NoneType
	except AssertionError as e:
		print('assert not user["wc_token"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["fb_token"] is NoneType
	except AssertionError as e:
		print('assert not user["fb_token"] is NoneType failed')
	except Exception as e:
		print(e)

	try:
		assert logmanager.create_logs_if_dne()
	except AssertionError as e:
		print('assert logmanager.create_logs_if_dne() failed')
	except Exception as e:
		print(e)
	
	try:
		assert logmanager.insert_log(user["id"], 0.5, 500000)
	except AssertionError as e:
		print('assert logmanager.insert_log(user["id"], 0.5, 500000) failed')
	except Exception as e:
		print(e)

	try:<commit_msg>Bug fixes.<commit_after>from types import *
from sqlite3 import Row
import random
from datetime import datetime
import common
import usermanager
import logmanager
import activitymanager

def run_tests():
	try:
		assert usermanager.create_users_if_dne()
	except AssertionError as e:
		print("assert usermanager.create_users_if_dne() failed")
	except Exception as e:
		print(e)
	
	# Generates random username
	random.seed(datetime.now().microsecond)
	username = random.randint(0, 10000)

	try:
		assert usermanager.insert_user(username)
	except AssertionError as e:
		print("assert usermanager.insert_user() failed")
	except Exception as e:
		print(e)

	try:
		assert usermanager.user_exists(username)
	except AssertionError as e:
		print("assert usermanager.user_exists('{}') failed".format(username))
	except Exception as e:
		print(e)
	
	try:
		assert not usermanager.user_exists("blablabla")
	except AssertionError as e:
		print("assert not usermanager.user_exists('blablabla') failed")
	except Exception as e:
		print(e)

	try:
		assert not usermanager.wc_info_filled(username)
	except AssertionError as e:
		print("assert not usermanager.wc_info_filled('{}') failed".format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.update_wc_info(username, "daily", "11111", "3590sxeioel34ios34109")
	except AssertionError as e:
		print('assert usermanager.update_wc_info("{}", "daily", "11111", "3590sxeioel34ios34109") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.wc_info_filled(username)
	except AssertionError as e:
		print('assert usermanager.wc_info_filled("{}") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert not usermanager.fb_info_filled(username)
	except AssertionError as e:
		print('assert not usermanager.fb_info_filled("{}") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.update_fb_info(username, "sl35902nej3390fh493wj394hlhk039")
	except AssertionError as e:
		print('assert usermanager.update_fb_info("{}", "sl35902nej3390fh493wj394hlhk039") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert usermanager.fb_info_filled(username)
	except AssertionError as e:
		print('assert usermanager.fb_info_filled("{}") failed'.format(username))
	except Exception as e:
		print(e)

	try:
		assert not usermanager.get_users() is NoneType
	except AssertionError as e:
		print('assert not usermanager.get_users() is NoneType failed')
	except Exception as e:
		print(e)

	try:
		assert not len(usermanager.get_users()) == 0
	except AssertionError as e:
		print('assert not len(usermanager.get_users()) == 0 failed')
	except Exception as e:
		print(e)

	user = usermanager.get_user(username)
	
	try:
		assert isinstance(user, Row)
	except AssertionError as e:
		print('assert isinstance(user, Row) failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["id"] is NoneType
	except AssertionError as e:
		print('assert not user["id"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["username"] is NoneType
	except AssertionError as e:
		print('assert not user["username"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["registered_on"] is NoneType
	except AssertionError as e:
		print('assert not user["registered_on"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["goal_period"] is NoneType
	except AssertionError as e:
		print('assert not user["goal_period"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["wc_id"] is NoneType
	except AssertionError as e:
		print('assert not user["wc_id"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["wc_token"] is NoneType
	except AssertionError as e:
		print('assert not user["wc_token"] is NoneType failed')
	except Exception as e:
		print(e)
	
	try:
		assert not user["fb_token"] is NoneType
	except AssertionError as e:
		print('assert not user["fb_token"] is NoneType failed')
	except Exception as e:
		print(e)

	try:
		assert logmanager.create_logs_if_dne()
	except AssertionError as e:
		print('assert logmanager.create_logs_if_dne() failed')
	except Exception as e:
		print(e)
	
	try:
		assert logmanager.insert_log(user["id"], 0.5, 0.25, 500000)
	except AssertionError as e:
		print('assert logmanager.insert_log(user["id"], 0.5, 500000) failed')
	except Exception as e:
		print(e)

	try:
{'fraction_non_alphanumeric': 0.10467060528369189, 'fraction_numerical': 0.021067885408538625, 'mean_word_length': 5.200414651002073, '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': '3868226', 'n_tokens_mistral': 3274, 'n_tokens_neox': 2969, 'n_words': 871}