<commit_before>import discord
import pkgutil
import sys
import json
import asyncio
import inspect
import time
import threading

import commands
import permissions

#import pyrepl
#interactive = None
loaded = False

#import traceback
#import warnings
import sys

def warn_with_traceback(message, category, filename, lineno, file=None, line=None):

    log = file if hasattr(file,'write') else sys.stderr
    traceback.print_stack(file=log)
    log.write(warnings.formatwarning(message, category, filename, lineno, line))

#warnings.showwarning = warn_with_traceback
#warnings.simplefilter("never")
####Helper stuff
async def loadPlugins():
    
    def load_all_modules_from_dir(dirname): #modded from: http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python/8556471#8556471
        modules = []
        errors = []
        for importer, package_name, _ in pkgutil.iter_modules([dirname]):
            full_package_name = '%s.%s' % (dirname, package_name)
            if full_package_name not in sys.modules:
                try:
                    mod = importer.find_module(package_name).load_module(package_name)
                    modules.append(mod)
                    print(mod)
                except Exception as e:
                    print("Failed to load " + str(package_name))
                    print(e)
                    errors.append("Failed to load " + str(package_name) + "\n" + str(e))
        return modules, errors
        
    (plugins, errors) = load_all_modules_from_dir("plugins")
    for plugin in plugins:
        plugin.client = client
        
    if len(errors) > 0:
        channel = client.get_channel(124051195949088768)
        daddy = client.get_user(102978533663440896).get_mention()
        await channel.send(daddy + " I am broken!")
        await channel.send(errors)<commit_msg>wrong api call for mention<commit_after>import discord
import pkgutil
import sys
import json
import asyncio
import inspect
import time
import threading

import commands
import permissions

#import pyrepl
#interactive = None
loaded = False

#import traceback
#import warnings
import sys

def warn_with_traceback(message, category, filename, lineno, file=None, line=None):

    log = file if hasattr(file,'write') else sys.stderr
    traceback.print_stack(file=log)
    log.write(warnings.formatwarning(message, category, filename, lineno, line))

#warnings.showwarning = warn_with_traceback
#warnings.simplefilter("never")
####Helper stuff
async def loadPlugins():
    
    def load_all_modules_from_dir(dirname): #modded from: http://stackoverflow.com/questions/1057431/loading-all-modules-in-a-folder-in-python/8556471#8556471
        modules = []
        errors = []
        for importer, package_name, _ in pkgutil.iter_modules([dirname]):
            full_package_name = '%s.%s' % (dirname, package_name)
            if full_package_name not in sys.modules:
                try:
                    mod = importer.find_module(package_name).load_module(package_name)
                    modules.append(mod)
                    print(mod)
                except Exception as e:
                    print("Failed to load " + str(package_name))
                    print(e)
                    errors.append("Failed to load " + str(package_name) + "\n" + str(e))
        return modules, errors
        
    (plugins, errors) = load_all_modules_from_dir("plugins")
    for plugin in plugins:
        plugin.client = client
        
    if len(errors) > 0:
        channel = client.get_channel(124051195949088768)
        daddy = client.get_user(102978533663440896).mention
        await channel.send(daddy + " I am broken!")
        await channel.send(errors)
{'fraction_non_alphanumeric': 0.0954435157724454, 'fraction_numerical': 0.03127527635481262, 'mean_word_length': 2.7741607324516786, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1144448', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1060, 'n_words': 255}