<commit_before>#!/usr/bin/env python
"""
info.py - Jenni Information Module
Copyright 2008, <NAME>, inamidst.com
Licensed under the Eiffel Forum License 2.

http://inamidst.com/phenny/
"""

def doc(jenni, input):
    """Shows a command's documentation, and possibly an example."""
    name = input.group(1)
    name = name.lower()

    if jenni.doc.has_key(name):
        jenni.reply(jenni.doc[name][0])
        if jenni.doc[name][1]:
            jenni.say('e.g. ' + jenni.doc[name][1])
doc.rule = ('$nick', '(?i)(?:help|doc) +([A-Za-z]+)(?:\?+)?$')
doc.example = '$nickname: doc tell?'
doc.priority = 'low'

def commands(jenni, input):
    # This function only works in private message
    #if input.sender.startswith('#'): return
    names = ', '.join(sorted(jenni.doc.iterkeys()))
    jenni.reply("I am sending you a private message of all my commands!")
    jenni.msg(input.nick, 'Commands I recognise: ' + names + '.')
    jenni.msg(input.nick, ("For help, do '%s: help example?' where example is the " +
                    "name of the command you want help for.") % jenni.nick)
commands.commands = ['commands']
commands.priority = 'low'

def help(jenni, input):
    response = (
        'Hi, I\'m a bot. Say ".commands" to me in private for a list ' +
        'of my commands, or see http://inamidst.com/phenny/ for more ' +
        'general details. My owner is %s.'
    ) % jenni.config.owner
    jenni.reply(response)
help.rule = ('$nick', r'(?i)help(?:[?!]+)?$')
help.priority = 'low'

def stats(jenni, input):
    """Show information on command usage patterns."""
    commands = {}
    users = {}
    channels = {}

    ignore = set(['f_note', 'startup', 'message', 'noteuri'])
    for (name, user), count in jenni.stats.iteritems():
        if name in ignore: continue
        if not user: continue

        if not user.startswith('#'):
            try: users[user] += count
            except KeyError: users[user] = count
        else:
            try: commands[name] += count
            except KeyError: commands[name] = count
<commit_msg>added alias for help<commit_after>#!/usr/bin/env python
"""
info.py - Jenni Information Module
Copyright 2008, <NAME>, inamidst.com
Licensed under the Eiffel Forum License 2.

http://inamidst.com/phenny/
"""

def doc(jenni, input):
    """Shows a command's documentation, and possibly an example."""
    name = input.group(1)
    name = name.lower()

    if jenni.doc.has_key(name):
        jenni.reply(jenni.doc[name][0])
        if jenni.doc[name][1]:
            jenni.say('e.g. ' + jenni.doc[name][1])
doc.rule = ('$nick', '(?i)(?:help|doc) +([A-Za-z]+)(?:\?+)?$')
doc.example = '$nickname: doc tell?'
doc.priority = 'low'

def commands(jenni, input):
    # This function only works in private message
    #if input.sender.startswith('#'): return
    names = ', '.join(sorted(jenni.doc.iterkeys()))
    jenni.reply("I am sending you a private message of all my commands!")
    jenni.msg(input.nick, 'Commands I recognise: ' + names + '.')
    jenni.msg(input.nick, ("For help, do '%s: help example?' where example is the " +
                    "name of the command you want help for.") % jenni.nick)
commands.commands = ['commands', 'help']
commands.priority = 'low'

def help(jenni, input):
    response = (
        'Hi, I\'m a bot. Say ".commands" to me in private for a list ' +
        'of my commands, or see http://inamidst.com/phenny/ for more ' +
        'general details. My owner is %s.'
    ) % jenni.config.owner
    jenni.reply(response)
help.rule = ('$nick', r'(?i)help(?:[?!]+)?$')
help.priority = 'low'

def stats(jenni, input):
    """Show information on command usage patterns."""
    commands = {}
    users = {}
    channels = {}

    ignore = set(['f_note', 'startup', 'message', 'noteuri'])
    for (name, user), count in jenni.stats.iteritems():
        if name in ignore: continue
        if not user: continue

        if not user.startswith('#'):
            try: users[user] += count
            except KeyError: users[user] = count
        else:
            try: commands[name] += count
            except KeyError: commands[name] = count

{'fraction_non_alphanumeric': 0.1668684911600872, 'fraction_numerical': 0.004359409057883265, 'mean_word_length': 2.8347260909935006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '569894', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1360, 'n_words': 390}