<commit_before>import asyncio
import datetime

from roxbot import checks, guild_settings, EmbedColours

import discord
from discord.ext import commands


# TODO: Display the settings your changing in the menu as yu change them.

class Menu:
	def __init__(self, name, settings, *params):
		self.name = name
		self.params = params
		self.formatted_params = self._parse_params(settings, self.name)
		self.title = "'Roxbot Settings: {}'\n".format(self.name)
		self.content = self._format_content(self.title, self.params, "```python", "```")

	@staticmethod
	def _format_content(title, params, prefix="", suffix=""):
		separator = "—————————————————————————————"
		choices = "\n"
		for x, setting in enumerate(params):
			if setting != "convert":
				if setting != [*params][x]:  # Just in case params is dict_keys, we make a new list
					choices += "[{}] {}\n".format(x + 1, setting)
				else:
					choices +=  "[{}] Edit '{}'\n".format(x+1, setting)
		choices += "[0] Exit\n"
		return prefix + title + separator + choices + suffix

	@staticmethod
	def _parse_params(settings, name):
		params = [*settings.keys()]
		params_copy = settings.copy().keys()
		for param in params_copy:
			if settings["convert"].get(param) == "bool":
				# Enable/Disable Parse
				if param == "enabled":
					options = ["Enable '{}'".format(name), "Disable '{}'".format(name)]
				else:
					options = ["Enable '{}'".format(param), "Disable '{}'".format(param)]
				params.remove(param)
				params = [*options, *params]
			elif isinstance(settings.get(param), list):
				# Add and Remove Parse
				options = ["Add {}".format(param), "Remove {}".format(param)]
				params.remove(param)
				params = [*params, *options]
			elif isinstance(settings.get(param), int) or isinstance(settings.get(param), str):
				# Set parse
				options = "Set {}".format(param)
				params.remove(param)
				params = [*params, options]
		return params

	@classmethod
	def nsfw(cls, guild):<commit_msg>fixed that isinstance and shit.<commit_after>import asyncio
import datetime

from roxbot import checks, guild_settings, EmbedColours

import discord
from discord.ext import commands


# TODO: Display the settings your changing in the menu as yu change them.

class Menu:
	def __init__(self, name, settings, *params):
		self.name = name
		self.params = params
		self.formatted_params = self._parse_params(settings, self.name)
		self.title = "'Roxbot Settings: {}'\n".format(self.name)
		self.content = self._format_content(self.title, self.params, "```python", "```")

	@staticmethod
	def _format_content(title, params, prefix="", suffix=""):
		separator = "—————————————————————————————"
		choices = "\n"
		for x, setting in enumerate(params):
			if setting != "convert":
				if setting != [*params][x]:  # Just in case params is dict_keys, we make a new list
					choices += "[{}] {}\n".format(x + 1, setting)
				else:
					choices +=  "[{}] Edit '{}'\n".format(x+1, setting)
		choices += "[0] Exit\n"
		return prefix + title + separator + choices + suffix

	@staticmethod
	def _parse_params(settings, name):
		params = [*settings.keys()]
		params_copy = settings.copy().keys()
		for param in params_copy:
			if settings["convert"].get(param) == "bool":
				# Enable/Disable Parse
				if param == "enabled":
					options = ["Enable '{}'".format(name), "Disable '{}'".format(name)]
				else:
					options = ["Enable '{}'".format(param), "Disable '{}'".format(param)]
				params.remove(param)
				params = [*options, *params]
			elif isinstance(settings.get(param), list):
				# Add and Remove Parse
				options = ["Add {}".format(param), "Remove {}".format(param)]
				params.remove(param)
				params = [*params, *options]
			elif isinstance(settings.get(param), (int, str)):
				# Set parse
				options = "Set {}".format(param)
				params.remove(param)
				params = [*params, options]
		return params

	@classmethod
	def nsfw(cls, guild):
{'fraction_non_alphanumeric': 0.1735558408215661, 'fraction_numerical': 0.0015404364569961489, 'mean_word_length': 4.053177691309987, 'pattern_counts': {'":': 6, '<': 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': '2945496', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1208, 'n_words': 347}