<commit_before>import re
from ..helpers import is_channel_name
from ..message import Message
from ..signals import admin_message_in, message_in, message_out, on_exception
from .base import BaseIdleModule
from .mixins import ConfigMixin, MessageDispatcherMixin
from .utils import parse_command


class BaseResponder(ConfigMixin, MessageDispatcherMixin, BaseIdleModule):
    """Inherit from this class to quickly create a module which reacts to users'
    messages. Each incomming PRIVMSG is dispatched to the `handle_privmsg` method
    and all incoming messages are dispatched to `handle_msg` method. If a message
    starts with a command_prefix defined in config it will be also sent to
    a proper handler, for example `command_help`.

    Example config:

        "botnet": {
            "base_responder": {
                "command_prefix": "."
            }
        }

    """

    # Don't send description of the .help command - normally each module which
    # is based on this class would respond to such request and flood a user with
    # messages. This should be set to False only in one module (by default in
    # module meta). Note that this parameter is a terrible workaround. The
    # problem is caused by the fact that modules do not have direct access to
    # each another, so it is not possible to query others modules for commands.
    # Each module has to report them separately, and in effect the same command<commit_msg>Removed duplicated comment<commit_after>import re
from ..helpers import is_channel_name
from ..message import Message
from ..signals import admin_message_in, message_in, message_out, on_exception
from .base import BaseIdleModule
from .mixins import ConfigMixin, MessageDispatcherMixin
from .utils import parse_command


class BaseResponder(ConfigMixin, MessageDispatcherMixin, BaseIdleModule):
    """Inherit from this class to quickly create a module which reacts to users'
    messages. 

    Example config:

        "botnet": {
            "base_responder": {
                "command_prefix": "."
            }
        }

    """

    # Don't send description of the .help command - normally each module which
    # is based on this class would respond to such request and flood a user with
    # messages. This should be set to False only in one module (by default in
    # module meta). Note that this parameter is a terrible workaround. The
    # problem is caused by the fact that modules do not have direct access to
    # each another, so it is not possible to query others modules for commands.
    # Each module has to report them separately, and in effect the same command
{'fraction_non_alphanumeric': 0.05203190277250285, 'fraction_numerical': 0.0, 'mean_word_length': 3.262135922330097, 'pattern_counts': {'":': 6, '<': 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': '7635766', 'n_tokens_mistral': 671, 'n_tokens_neox': 641, 'n_words': 329}