<commit_before>from lrrbot import bot
import storage
import utils

def set_show(lrrbot, show):
    lrrbot.show = show.lower()

def show_name(show):
    return storage.data.get("shows", {}).get(show, {}).get("name", show)

@bot.command("show")
@utils.throttle()
def get_show(lrrbot, conn, event, respond_to):
    """
    Command: !show

    Post the current show.
    """
    if lrrbot.show == "":
        conn.privmsg(respond_to, "Current show not set.")
    else:
        conn.privmsg(respond_to, "Currently live: %s" % show_name(lrrbot.show))

@bot.command("show override (.*?)")
@utils.mod_only
def show_override(lrrbot, conn, event, respond_to, show):
    """
    Command: !show override ID

    Override the current show.
    --command
    Command: !show override off

    Disable the override.
    """
    set_show(lrrbot, show if show != "off" else "")
    return get_show.__wrapped__(lrrbot, conn, event, respond_to)<commit_msg>Only allow moderator changing to shows that exist<commit_after>from lrrbot import bot
import storage
import utils

def set_show(lrrbot, show):
    lrrbot.show = show.lower()

def show_name(show):
    return storage.data.get("shows", {}).get(show, {}).get("name", show)

@bot.command("show")
@utils.throttle()
def get_show(lrrbot, conn, event, respond_to):
    """
    Command: !show

    Post the current show.
    """
    if lrrbot.show == "":
        conn.privmsg(respond_to, "Current show not set.")
    else:
        conn.privmsg(respond_to, "Currently live: %s" % show_name(lrrbot.show))

@bot.command("show override (.*?)")
@utils.mod_only
def show_override(lrrbot, conn, event, respond_to, show):
    """
    Command: !show override ID

    Override the current show.
    --command
    Command: !show override off

    Disable the override.
    """
    show = show.lower()
    if show == "off":
        show = ""
    if show not in storage.data.get("shows", {}):
        shows = sorted(storage.data.get("shows", {}).keys())
        shows = [s for s in shows if s]
        conn.privmsg(respond_to, "Recognised shows: %s" % ", ".join(shows))
        return
    set_show(lrrbot, show)
    return get_show.__wrapped__(lrrbot, conn, event, respond_to)
{'fraction_non_alphanumeric': 0.14664230242119689, 'fraction_numerical': 0.0, 'mean_word_length': 3.3025540275049114, 'pattern_counts': {'":': 3, '<': 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': '5956033', 'n_tokens_mistral': 745, 'n_tokens_neox': 733, 'n_words': 194}