<commit_before>import collections
import json
import logging

import irc
import regex as re
import requests

from pajbot.managers.schedule import ScheduleManager
from pajbot.modules.ascii import AsciiProtectionModule

log = logging.getLogger(__name__)


class ActionParser:
    bot = None

    def parse(raw_data=None, data=None, command=''):
        try:
            from pajbot.userdispatch import UserDispatch
            Dispatch = UserDispatch
        except ImportError:
            log.exception('Unable to import UserDispatch')
            from pajbot.dispatch import Dispatch
        except:
            from pajbot.dispatch import Dispatch
            log.exception('Something went wrong while attemting to import UserDispatch')

        if not data:
            data = json.loads(raw_data)

        if data['type'] == 'say':
            action = SayAction(data['message'], ActionParser.bot)
        elif data['type'] == 'me':
            action = MeAction(data['message'], ActionParser.bot)<commit_msg>Remove excessive error message<commit_after>import collections
import json
import logging
import sys

import irc
import regex as re
import requests

from pajbot.managers.schedule import ScheduleManager
from pajbot.modules.ascii import AsciiProtectionModule

log = logging.getLogger(__name__)


class ActionParser:
    bot = None

    def parse(raw_data=None, data=None, command=''):
        try:
            from pajbot.userdispatch import UserDispatch
            Dispatch = UserDispatch
        except ImportError:
            from pajbot.dispatch import Dispatch
        except:
            log.exception('Something went wrong while attemting to import Dispatch, this should never happen')
            sys.exit(1)

        if not data:
            data = json.loads(raw_data)

        if data['type'] == 'say':
            action = SayAction(data['message'], ActionParser.bot)
        elif data['type'] == 'me':
            action = MeAction(data['message'], ActionParser.bot)
{'fraction_non_alphanumeric': 0.08032128514056225, 'fraction_numerical': 0.000502008032128514, 'mean_word_length': 2.7462406015037595, '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': '5275991', 'n_tokens_mistral': 517, 'n_tokens_neox': 505, 'n_words': 159}