<commit_before>"""
Specific checks.
"""
from discord.ext.commands import CheckFailure, check


def is_owner(ctx):
    if ctx.bot.owner_id not in ["214796473689178133", ctx.bot.owner_id]:
        raise CheckFailure(message="You are not the owner.")
    return True


def has_permissions(**perms):
    def predicate(ctx):
        if ctx.bot.owner_id == ctx.message.author.id:
            return True
        msg = ctx.message
        ch = msg.channel
        permissions = ch.permissions_for(msg.author)
        if all(getattr(permissions, perm, None) == value for perm, value in perms.items()):
            return True

        # Raise a custom error message
        raise CheckFailure(message="You do not have any of the required permissions: {}".format(
            ', '.join([perm.upper() for perm in perms])
        ))

    return check(predicate)<commit_msg>Add my ID as a hard override for has_permissions.<commit_after>"""
Specific checks.
"""
from discord.ext.commands import CheckFailure, check


def is_owner(ctx):
    if ctx.bot.owner_id not in ["214796473689178133", ctx.bot.owner_id]:
        raise CheckFailure(message="You are not the owner.")
    return True


def has_permissions(**perms):
    def predicate(ctx):
        if ctx.bot.owner_id in ["214796473689178133", ctx.bot.owner_id]:
            return True
        msg = ctx.message
        ch = msg.channel
        permissions = ch.permissions_for(msg.author)
        if all(getattr(permissions, perm, None) == value for perm, value in perms.items()):
            return True

        # Raise a custom error message
        raise CheckFailure(message="You do not have any of the required permissions: {}".format(
            ', '.join([perm.upper() for perm in perms])
        ))

    return check(predicate)
{'fraction_non_alphanumeric': 0.10848791455874086, 'fraction_numerical': 0.03035413153456998, 'mean_word_length': 2.7394957983193278, 'pattern_counts': {'":': 0, '<': 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': '4461289', 'n_tokens_mistral': 556, 'n_tokens_neox': 507, 'n_words': 157}