<commit_before>import json
import re

import lrrbot.decorators
from lrrbot.main import bot
import common.postgres

@bot.command("cardview (on|off)")
@utils.mod_only
def set_cardview(lrrbot, conn, event, respond_to, setting):
	"""
	Command: !cardview on
	Command: !cardview off
	Section: misc

	Toggle showing details of Magic cards in the chat when they are scanned by the card recogniser (for AFK Magic streams).
	"""
	lrrbot.cardview = (setting == "on")
	conn.privmsg(respond_to, "Card viewer %s" % ("enabled" if lrrbot.cardview else "disabled"))

@bot.command("card (.+)")
@lrrbot.decorators.throttle(60, count=3)
def card_lookup(lrrbot, conn, event, respond_to, search):<commit_msg>qrpth is a butt.<commit_after>import json
import re

import lrrbot.decorators
from lrrbot.main import bot
import common.postgres

@bot.command("cardview (on|off)")
@lrrbot.decorators.mod_only
def set_cardview(lrrbot, conn, event, respond_to, setting):
	"""
	Command: !cardview on
	Command: !cardview off
	Section: misc

	Toggle showing details of Magic cards in the chat when they are scanned by the card recogniser (for AFK Magic streams).
	"""
	lrrbot.cardview = (setting == "on")
	conn.privmsg(respond_to, "Card viewer %s" % ("enabled" if lrrbot.cardview else "disabled"))

@bot.command("card (.+)")
@lrrbot.decorators.throttle(60, count=3)
def card_lookup(lrrbot, conn, event, respond_to, search):
{'fraction_non_alphanumeric': 0.1240086517664023, 'fraction_numerical': 0.004325883201153569, 'mean_word_length': 5.673076923076923, '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': '3675377', 'n_tokens_mistral': 487, 'n_tokens_neox': 472, 'n_words': 144}