<commit_before>import sys, traceback, datetime

from reconbot.notificationprinters.slack import Slack
from reconbot.notificationprinters.discord import Discord
from reconbot.notificationprinters.esi.slack import Slack as ESISlack
from reconbot.notificationprinters.esi.discord import Discord as ESIDiscord
from reconbot.esi import ESI

def esi_notification_task(notification_options, api_queue, printer, notifier):
    MAX_NOTIFICATION_AGE_IN_SECONDS = 3600

    try:
        sso = api_queue.get()

        esi = ESI(sso)

        notifications = esi.get_new_notifications(max_age=MAX_NOTIFICATION_AGE_IN_SECONDS)

        if notification_options['whitelist']:
            notifications = [notification for notification in notifications if notification['type'] in notification_options['whitelist']]

        if printer == 'discord':
            printer = ESIDiscord(esi)
        else:
            printer = ESISlack(esi)

        messages = map(lambda text: printer.transform(text), notifications)

        for message in messages:
            notifier.notify(message)

    except Exception as e:
        notify_exception("esi_notification_task", e)

def notify_exception(location, exception):<commit_msg>Remove unused imports<commit_after>import sys, traceback, datetime

from reconbot.notificationprinters.esi.slack import Slack as ESISlack
from reconbot.notificationprinters.esi.discord import Discord as ESIDiscord
from reconbot.esi import ESI

def esi_notification_task(notification_options, api_queue, printer, notifier):
    MAX_NOTIFICATION_AGE_IN_SECONDS = 3600

    try:
        sso = api_queue.get()

        esi = ESI(sso)

        notifications = esi.get_new_notifications(max_age=MAX_NOTIFICATION_AGE_IN_SECONDS)

        if notification_options['whitelist']:
            notifications = [notification for notification in notifications if notification['type'] in notification_options['whitelist']]

        if printer == 'discord':
            printer = ESIDiscord(esi)
        else:
            printer = ESISlack(esi)

        messages = map(lambda text: printer.transform(text), notifications)

        for message in messages:
            notifier.notify(message)

    except Exception as e:
        notify_exception("esi_notification_task", e)

def notify_exception(location, exception):
{'fraction_non_alphanumeric': 0.07285342584562012, 'fraction_numerical': 0.003469210754553339, 'mean_word_length': 3.756701030927835, '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': '3553218', 'n_tokens_mistral': 667, 'n_tokens_neox': 642, 'n_words': 155}