<commit_before>from collections import OrderedDict
import datetime
import random

from discord.ext import commands
import discord
import asyncio


class Meta:
    def __init__(self, bot):
        self.bot = bot

    @commands.command(name='help')
    async def help_cmd(self, cmd=None):
        """Print this help."""
        if cmd is None:
            coms = OrderedDict()
            com_list = [
                'help', 'info', 'uptime', 'poke', 'roll',
                'stream', 'join', 'leave', 'kick', 'ban']
            width = max(map(lambda t: len(t), com_list)) + 1
            for com in com_list:
                coms[com] = self.bot.commands[com]
            message = ['Available commands:', '```']
            for i, com in enumerate(coms):
                message.append('{0:<{width}}: {1}'.format(
                    com, coms[com].help.splitlines()[0], width=width))
            message.append(
                '\nTo see help for individual commands, '
                'use {}help command'.format(self.bot.command_prefix))
            message.append('```')
            message = '\n'.join(message)
            await self.bot.say(message)
        else:
            try:
                message = self.bot.commands[cmd].help.format(
                    prefix=self.bot.command_prefix)
            except:
                return
            await self.bot.say('```' + message + '```')

    @commands.command()
    async def info(self):
        """Print bot information."""
        source_link = 'https://github.com/mikevb1/discordbot'
        message = 'This bot is written in Python using discord.py from ' + \
            'https://github.com/Rapptz/discord.py/tree/async.'
        message += '\nThe source code can be found at {}.'.format(source_link)
        message += '\nThe dev is {} in Discord.'.format('sgtlaggy#5516')
        await self.bot.say(message)

    @commands.command()
    async def uptime(self):
        """Display bot uptime."""
        now = datetime.datetime.utcnow()
        delta = now - self.bot.uptime
        hours, remainder = divmod(int(delta.total_seconds()), 3600)
        minutes, seconds = divmod(remainder, 60)
        days, hours = divmod(hours, 24)
        if days:
            fmt = '{d} day{dp}, {h} hour{hp}, {m} minute{mp}, {s} second{sp}'
        elif hours:
            fmt = '{h} hour{hp}, {m} minute{mp}, {s} second{sp}'
        elif minutes:
            fmt = '{m} minute{mp}, {s} second{sp}'
        elif seconds:
            fmt = '{s} second{sp}'

        def plural(num):
            return 's' if num != 1 else ''

        up = fmt.format(
            d=days, dp=plural(days),
            h=hours, hp=plural(hours),
            m=minutes, mp=plural(minutes),
            s=seconds, sp=plural(seconds))
        await self.bot.say('Uptime: **{}**'.format(up))

    @commands.command()
    async def poke(self):
        """Make sure bot is working."""
        replies = [
            'Hey!', 'Ow!', 'Stop that!', "I'm here!", 'I need an adult!']
        await self.bot.say(random.choice(replies))

    @commands.command(name='id', pass_context=True)
    async def get_id(self, ctx):
        """Get discord ID's."""
        for m in ctx.message.mentions:
            await self.bot.say('{0.name}#{0.discriminator}: {0.id}'.format(m))
        for c in ctx.message.channel_mentions:
            await self.bot.say('{0.name}: {0.id}'.format(c))

    @commands.command()
    async def join(self):
        """Add bot to one of your servers."""
        if self.bot.client_id is None:
            return
        perm = discord.Permissions()
        perm.kick_members = True
        perm.ban_members = True
        perm.read_messages = True
        perm.send_messages = True
        perm.manage_messages = True
        perm.embed_links = True
        url = discord.utils.oauth_url(self.bot.client_id, permissions=perm)<commit_msg>add symbols to id<commit_after>from collections import OrderedDict
import datetime
import random

from discord.ext import commands
import discord
import asyncio


class Meta:
    def __init__(self, bot):
        self.bot = bot

    @commands.command(name='help')
    async def help_cmd(self, cmd=None):
        """Print this help."""
        if cmd is None:
            coms = OrderedDict()
            com_list = [
                'help', 'info', 'uptime', 'poke', 'roll',
                'stream', 'join', 'leave', 'kick', 'ban']
            width = max(map(lambda t: len(t), com_list)) + 1
            for com in com_list:
                coms[com] = self.bot.commands[com]
            message = ['Available commands:', '```']
            for i, com in enumerate(coms):
                message.append('{0:<{width}}: {1}'.format(
                    com, coms[com].help.splitlines()[0], width=width))
            message.append(
                '\nTo see help for individual commands, '
                'use {}help command'.format(self.bot.command_prefix))
            message.append('```')
            message = '\n'.join(message)
            await self.bot.say(message)
        else:
            try:
                message = self.bot.commands[cmd].help.format(
                    prefix=self.bot.command_prefix)
            except:
                return
            await self.bot.say('```' + message + '```')

    @commands.command()
    async def info(self):
        """Print bot information."""
        source_link = 'https://github.com/mikevb1/discordbot'
        message = 'This bot is written in Python using discord.py from ' + \
            'https://github.com/Rapptz/discord.py/tree/async.'
        message += '\nThe source code can be found at {}.'.format(source_link)
        message += '\nThe dev is {} in Discord.'.format('sgtlaggy#5516')
        await self.bot.say(message)

    @commands.command()
    async def uptime(self):
        """Display bot uptime."""
        now = datetime.datetime.utcnow()
        delta = now - self.bot.uptime
        hours, remainder = divmod(int(delta.total_seconds()), 3600)
        minutes, seconds = divmod(remainder, 60)
        days, hours = divmod(hours, 24)
        if days:
            fmt = '{d} day{dp}, {h} hour{hp}, {m} minute{mp}, {s} second{sp}'
        elif hours:
            fmt = '{h} hour{hp}, {m} minute{mp}, {s} second{sp}'
        elif minutes:
            fmt = '{m} minute{mp}, {s} second{sp}'
        elif seconds:
            fmt = '{s} second{sp}'

        def plural(num):
            return 's' if num != 1 else ''

        up = fmt.format(
            d=days, dp=plural(days),
            h=hours, hp=plural(hours),
            m=minutes, mp=plural(minutes),
            s=seconds, sp=plural(seconds))
        await self.bot.say('Uptime: **{}**'.format(up))

    @commands.command()
    async def poke(self):
        """Make sure bot is working."""
        replies = [
            'Hey!', 'Ow!', 'Stop that!', "I'm here!", 'I need an adult!']
        await self.bot.say(random.choice(replies))

    @commands.command(name='id', pass_context=True)
    async def get_id(self, ctx):
        """Get discord ID's."""
        for m in ctx.message.mentions:
            await self.bot.say('@{0.name}#{0.discriminator}: {0.id}'.format(m))
        for c in ctx.message.channel_mentions:
            await self.bot.say('#{0.name}: {0.id}'.format(c))

    @commands.command()
    async def join(self):
        """Add bot to one of your servers."""
        if self.bot.client_id is None:
            return
        perm = discord.Permissions()
        perm.kick_members = True
        perm.ban_members = True
        perm.read_messages = True
        perm.send_messages = True
        perm.manage_messages = True
        perm.embed_links = True
        url = discord.utils.oauth_url(self.bot.client_id, permissions=perm)
{'fraction_non_alphanumeric': 0.14682437644638724, 'fraction_numerical': 0.005914116739521728, 'mean_word_length': 1.9758990053557766, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '2582964', 'n_tokens_mistral': 2418, 'n_tokens_neox': 2330, 'n_words': 582}