<commit_before>import logging
log = logging.getLogger(__name__)

from email.mime.text import MIMEText
import os
import pwd
import subprocess
import traceback


class ErrorHandler:
	def __init__(self, bot):
		self.bot = bot

	def handle_error(self, exception=None):
		long_msg = traceback.format_exc()

		if isinstance(exception, str):
			short_msg = exception.split('\n')[0]
		elif isinstance(exception, Exception):
			short_msg = 'Uncaught exception - {}: {}'.format(
				type(exception).__name__, + str(exception))
		else:
			short_msg = long_msg.split('\n')[-1]

		log.exception(short_msg)

		self.bot._send_msg(short_msg, self.bot.get_admin_nicks())

		email = MIMEText(long_msg)
		user = pwd.getpwuid(os.getuid())[0]<commit_msg>where did that + come from?<commit_after>import logging
log = logging.getLogger(__name__)

from email.mime.text import MIMEText
import os
import pwd
import subprocess
import traceback


class ErrorHandler:
	def __init__(self, bot):
		self.bot = bot

	def handle_error(self, exception=None):
		long_msg = traceback.format_exc()

		if isinstance(exception, str):
			short_msg = exception.split('\n')[0]
		elif isinstance(exception, Exception):
			short_msg = 'Uncaught exception - {}: {}'.format(
				type(exception).__name__, str(exception))
		else:
			short_msg = long_msg.split('\n')[-1]

		log.exception(short_msg)

		self.bot._send_msg(short_msg, self.bot.get_admin_nicks())

		email = MIMEText(long_msg)
		user = pwd.getpwuid(os.getuid())[0]
{'fraction_non_alphanumeric': 0.13058186738836267, 'fraction_numerical': 0.0040595399188092015, 'mean_word_length': 4.892430278884462, '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': '6669135', 'n_tokens_mistral': 551, 'n_tokens_neox': 508, 'n_words': 107}