<commit_before>from jeeves.core.plugin import CommandPlugin

"""
    Help Plugin.
    A basic Jeeves plugin that displays help messages for the user. T
"""
class HelpPlugin(CommandPlugin):
    name = 'Help Plugin'
    command = ['help', '-h']

    def __init__(self, *args, **kwargs):
        super(HelpPlugin, self).__init__(self.name, self.command, *args, **kwargs)

    def handle_message(self, channel, nickname, message, command):
        tokenized_msg = message.split()

        if tokenized_msg and tokenized_msg[0] == "list_commands":
            self.say(channel, "%s: Here's a list of all of the available commands:" % nickname)
            for key in self.handler._command_plugins.keys():
                self.say(channel, "Jeeves: %s" % key)
        elif tokenized_msg and tokenized_msg[0] in self.handler._command_plugins.keys():
            for text in self.handler._command_plugins[tokenized_msg[0]].help_text:
                self.say(channel, text)
        else:
            for text in self.help_text:
                self.say(channel, text)

    @property
    def help_text(self):
        help_text = [
            "usage: Jeeves: [help|-h] [list_commands] [command_name]",
            "To list available plugins `Jeeves: help list_commands`",
            "To get specific help for a plugin `Jeeves: help [command_name]`",
        ]

        return help_text
<commit_msg>Help plugin now displays help in private message. REF #8<commit_after>from jeeves.core.plugin import CommandPlugin

"""
    Help Plugin.
    A basic Jeeves plugin that displays help messages for the user. T
"""
class HelpPlugin(CommandPlugin):
    name = 'Help Plugin'
    command = ['help', '-h']

    def __init__(self, *args, **kwargs):
        super(HelpPlugin, self).__init__(self.name, self.command, *args, **kwargs)

    def handle_message(self, channel, nickname, message, command):
        tokenized_msg = message.split()

        if tokenized_msg and tokenized_msg[0] == "list_commands":
            self.say(nickname, "Here's a list of all of the available commands:")
            for key in self.handler._command_plugins.keys():
                self.say(nickname, "Jeeves: %s" % key)
        elif tokenized_msg and tokenized_msg[0] in self.handler._command_plugins.keys():
            for text in self.handler._command_plugins[tokenized_msg[0]].help_text:
                self.say(nickname, text)
        else:
            for text in self.help_text:
                self.say(nickname, text)

    @property
    def help_text(self):
        help_text = [
            "usage: Jeeves: [help|-h] [list_commands] [command_name]",
            "To list available plugins `Jeeves: help list_commands`",
            "To get specific help for a plugin `Jeeves: help [command_name]`",
        ]

        return help_text

{'fraction_non_alphanumeric': 0.10988620199146515, 'fraction_numerical': 0.0024893314366998577, 'mean_word_length': 2.625, 'pattern_counts': {'":': 2, '<': 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': '7631696', 'n_tokens_mistral': 830, 'n_tokens_neox': 801, 'n_words': 237}