<commit_before>"""
miscellaneous commands that may or may not be useful
"""
import discord
from discord.ext import commands
import time
import json
import requests

class Misc:
  def __init__(self, bot_):
    self.bot = bot_
    with open('config.json') as file_in:
      self.config = json.load(file_in)

  def update_config(self):
    with open('config.json', 'r') as file_in:
      self.config = json.load(file_in)

  def clean_check(self, context):
    for server in self.config['servers']:
      if server['id'] == context.server.id:
        server_prefix = server['prefix']
        break
    if context.content.startswith(self.bot.command_prefix) or context.content.startswith(server_prefix) or context.author == self.bot.user:
      return True
    return False

  def module_check(self, context):
    self.update_config()
    for server in self.config['servers']:
      if server['id'] == context.message.server.id:
        if "Misc" in server['enabled_modules']:
          return True
        break
    return False

  @commands.command(name="clean", pass_context=True)
  async def clean_spam(self, ctx, count: int = -1):<commit_msg>dammit<commit_after>"""
miscellaneous commands that may or may not be useful
"""
import discord
from discord.ext import commands
import time
import json
import requests

class Misc:
  def __init__(self, bot_):
    self.bot = bot_
    with open('config.json') as file_in:
      self.config = json.load(file_in)

  def update_config(self):
    with open('config.json', 'r') as file_in:
      self.config = json.load(file_in)

  def clean_check(self, context):
    for server in self.config['servers']:
      if server['id'] == context.server.id:
        server_prefix = server['prefix']
        break
    if context.content.startswith(self.config['prefix']) or context.content.startswith(server_prefix) or context.author == self.bot.user:
      return True
    return False

  def module_check(self, context):
    self.update_config()
    for server in self.config['servers']:
      if server['id'] == context.message.server.id:
        if "Misc" in server['enabled_modules']:
          return True
        break
    return False

  @commands.command(name="clean", pass_context=True)
  async def clean_spam(self, ctx, count: int = -1):
{'fraction_non_alphanumeric': 0.11736263736263736, 'fraction_numerical': 0.0008791208791208791, 'mean_word_length': 3.4280155642023344, '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': '1141031', 'n_tokens_mistral': 706, 'n_tokens_neox': 693, 'n_words': 193}