<commit_before>import logging

from twisted.internet import task


class CommandTemplate(object):
	triggers = []
	helptext = "This help text has not yet been filled in. Oops"
	showInCommandList = True
	stopAfterThisCommand = False  #Some modules might affect the command list, which leads to errors. If this is set to true and the command fires, no further commands are executed
	adminOnly = False
	scheduledFunctionTime = -1.0
	callInThread = False
	allowedMessageTypes = ['say']
	
	def __init__(self):
		if self.scheduledFunctionTime > 0.0:
			self.logInfo("Executing looping function every {} seconds".format(self.scheduledFunctionTime))
			self.scheduledFunctionTimer = task.LoopingCall(self.executeScheduledFunction)
			self.scheduledFunctionTimer.start(self.scheduledFunctionTime)
		self.onLoad()

	def onLoad(self):<commit_msg>Move onLoad to before starting the scheduled looping function, so onLoad can init stuff for the loop<commit_after>import logging

from twisted.internet import task


class CommandTemplate(object):
	triggers = []
	helptext = "This help text has not yet been filled in. Oops"
	showInCommandList = True
	stopAfterThisCommand = False  #Some modules might affect the command list, which leads to errors. If this is set to true and the command fires, no further commands are executed
	adminOnly = False
	scheduledFunctionTime = -1.0
	callInThread = False
	allowedMessageTypes = ['say']
	
	def __init__(self):
		self.onLoad()  #Put this before starting the scheduled function because it may rely on loaded data
		if self.scheduledFunctionTime > 0.0:
			self.logInfo("Executing looping function every {} seconds".format(self.scheduledFunctionTime))
			self.scheduledFunctionTimer = task.LoopingCall(self.executeScheduledFunction)
			self.scheduledFunctionTimer.start(self.scheduledFunctionTime)

	def onLoad(self):
{'fraction_non_alphanumeric': 0.07173913043478261, 'fraction_numerical': 0.004347826086956522, 'mean_word_length': 5.219594594594595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '785967', 'n_tokens_mistral': 531, 'n_tokens_neox': 506, 'n_words': 177}