<commit_before># Bring in the error handlers
import handlers

# Setting up globals
loadedPlugins = {}

# Initialize a plugin and import it
def init(name):
	try:
		loadedPlugins[name] = __import__('plugins.' + name + '.main',fromlist='main') # fromlist stops it from importing as the root module? python is weird
		loadedPlugins[name].init()
	except Exception as e:
		handlers.err("loading plugin " + name + " :: Exception raised :: " + str(e))

# Get rid of a plugin
def unload(name):
	del(loadedPlugins[name])

# Runs an individual plugin print function
def printPlugin(name,printer):
    try:
        loadedPlugins[name].print(printer)
    except Exception as e:
        handlers.err("running print for plugin " + name + " :: Exception raised :: " + str(e))

# Runs all plugins' print functions
def printAllPlugins(printer):
    for plugin in loadedPlugins:
        printPlugin(plugin,printer)<commit_msg>Added carriage returns before printing plugin<commit_after># Bring in the error handlers
import handlers

# Setting up globals
loadedPlugins = {}

# Initialize a plugin and import it
def init(name):
	try:
		loadedPlugins[name] = __import__('plugins.' + name + '.main',fromlist='main') # fromlist stops it from importing as the root module? python is weird
		loadedPlugins[name].init()
	except Exception as e:
		handlers.err("loading plugin " + name + " :: Exception raised :: " + str(e))

# Get rid of a plugin
def unload(name):
	del(loadedPlugins[name])

# Runs an individual plugin print function
def printPlugin(name,printer):
    try:
        printer.control("CR")
        loadedPlugins[name].print(printer)
        printer.control("CR")
    except Exception as e:
        handlers.err("running print for plugin " + name + " :: Exception raised :: " + str(e))

# Runs all plugins' print functions
def printAllPlugins(printer):
    for plugin in loadedPlugins:
        printPlugin(plugin,printer)
{'fraction_non_alphanumeric': 0.10912906610703044, 'fraction_numerical': 0.0, 'mean_word_length': 4.154054054054054, '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': '7425011', 'n_tokens_mistral': 564, 'n_tokens_neox': 552, 'n_words': 186}