<commit_before>import irc3
from irc3 import utils, asyncio
import re

__doc__ = '''
==================================================
:mod:`irc3.plugins.autocommand` Autocommand plugin
==================================================

Plugin allows send IRC commands after connecting to server. This could
be usable for authorization, cloaking, requesting invite to invite only channel
and other use cases. Also, plugin allows to set delay between IRC commands via
``/sleep`` command.

..
    >>> from irc3.testing import IrcBot

Usage::

This example will authorize you in FreeNode IRC network.

    >>> bot = IrcBot(autocommands=['PRIVMSG NickServ IDENTIFY nick password'])
    >>> bot.include('irc3.plugins.autocommand')

Here's another, more complicated example.

    >>> bot = IrcBot(autocommands=[
    ...     'AUTH user password', 'MODE {nick} +x', '/sleep 2',
    ...     'PRIVMSG Q INVITE #inviteonly'
    ... ])
    >>> bot.include('irc3.plugins.autocommand')

It will authorize bot in QuakeNet IRC network, cloak and then after 3 seconds
delay will request invite to ``#inviteonly`` channel.
'''


class SimpleCommand:

    def __init__(self, cmd):
        self.cmd = cmd

    @asyncio.coroutine
    def execute(self, bot):
        send_cmd = self.cmd.format(nick=bot.nick)<commit_msg>[autocommand] Misc rewording in docstring<commit_after>import irc3
from irc3 import utils, asyncio
import re

__doc__ = '''
==================================================
:mod:`irc3.plugins.autocommand` Autocommand plugin
==================================================

This plugin allows to send IRC commands to the server after connecting.
This could be usable for authorization, cloaking, requesting invite to invite
only channel and other use cases.
It also allows to set delays between IRC commands via the ``/sleep`` command.

..
    >>> from irc3.testing import IrcBot

Usage::

This example will authorize on Freenode.

    >>> bot = IrcBot(autocommands=['PRIVMSG NickServ IDENTIFY nick password'])
    >>> bot.include('irc3.plugins.autocommand')

Here's another, more complicated example.

    >>> bot = IrcBot(autocommands=[
    ...     'AUTH user password', 'MODE {nick} +x', '/sleep 2',
    ...     'PRIVMSG Q INVITE #inviteonly'
    ... ])
    >>> bot.include('irc3.plugins.autocommand')

It will authorize on QuakeNet, cloak and request an invite to ``#inviteonly``
after a 2 second delay.
'''


class SimpleCommand:

    def __init__(self, cmd):
        self.cmd = cmd

    @asyncio.coroutine
    def execute(self, bot):
        send_cmd = self.cmd.format(nick=bot.nick)
{'fraction_non_alphanumeric': 0.17939814814814814, 'fraction_numerical': 0.006172839506172839, 'mean_word_length': 4.005791505791506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '3921383', 'n_tokens_mistral': 773, 'n_tokens_neox': 729, 'n_words': 252}