<commit_before>var status_classes = 'alert-error alert-success alert-info';

function clear_compose_box() {
    $("#zephyr_compose").find('input[type=text], textarea').val('');
}

function compose_button() {
    clear_compose_box();
    $('#sidebar a[href="#home"]').tab('show');
    show_compose('class', $("#class"));
}

function hide_compose() {
    $('input, textarea, button').blur();
    $('.zephyr_compose').slideUp(100);
}

function show_compose(tabname, focus_area) {
    $('.zephyr_compose').slideDown(100);
    $('#zephyr-type-tabs a[href="#' + tabname + '-message"]').tab('show');
    focus_area.focus();
    focus_area.select();
}

function toggle_compose() {
    if ($("#zephyr-type-tabs li.active").find("a[href=#class-message]").length !== 0) {
        // In class tab, switch to personals.
        show_compose('personal', $("#recipient"));
    } else {
        show_compose('class', $("#class"));
    }
}

function composing_class_message() {
    return $("#class-message").is(":visible");
}

function composing_huddle_message() {
    return $("#personal-message").is(":visible");
}

function compose_class_name() {
    return $.trim($("#class").val());
}

function compose_instance() {
    return $.trim($("#instance").val());
}

function compose_message() {
    return $.trim($("#new_zephyr").val());
}

function compose_recipient() {
    return $.trim($("#recipient").val());
}

function compose_huddle_message() {
    return $.trim($("#new_personal_zephyr").val());
}

function compose_error(error_text, bad_input) {
    $('#send-status').removeClass(status_classes)
               .addClass('alert-error')
               .text(error_text)
               .stop(true).fadeTo(0, 1);
    $('#class-message, #personal-message').find('input[type="submit"]').removeAttr('disabled');
    bad_input.focus().select();
}

// *Synchronously* check if a class exists.
// If not, displays an error and returns false.
function check_class_for_send(class_name) {
    var okay = true;
    $.ajax({
        url: "subscriptions/exists/" + class_name,
        async: false,
        success: function (data) {
            if (data === "False") {
                // The class doesn't exist
                okay = false;
                send_status.removeClass(status_classes);
                send_status.show();
                $('#class-dne-name').text(class_name);
                $('#class-dne').show();
                $('#create-it').focus();
                buttons.removeAttr('disabled');
                hide_compose();
            }
            $("#home-error").hide();
        },
        error: function (xhr) {
            okay = false;
            report_error("Error checking subscription", xhr, $("#home-error"));
            $("#class").focus();
            buttons.removeAttr('disabled');
        }
    });
    return okay;
}<commit_msg>Fix an undefined variable<commit_after>var status_classes = 'alert-error alert-success alert-info';

function clear_compose_box() {
    $("#zephyr_compose").find('input[type=text], textarea').val('');
}

function compose_button() {
    clear_compose_box();
    $('#sidebar a[href="#home"]').tab('show');
    show_compose('class', $("#class"));
}

function hide_compose() {
    $('input, textarea, button').blur();
    $('.zephyr_compose').slideUp(100);
}

function show_compose(tabname, focus_area) {
    $('.zephyr_compose').slideDown(100);
    $('#zephyr-type-tabs a[href="#' + tabname + '-message"]').tab('show');
    focus_area.focus();
    focus_area.select();
}

function toggle_compose() {
    if ($("#zephyr-type-tabs li.active").find("a[href=#class-message]").length !== 0) {
        // In class tab, switch to personals.
        show_compose('personal', $("#recipient"));
    } else {
        show_compose('class', $("#class"));
    }
}

function composing_class_message() {
    return $("#class-message").is(":visible");
}

function composing_huddle_message() {
    return $("#personal-message").is(":visible");
}

function compose_class_name() {
    return $.trim($("#class").val());
}

function compose_instance() {
    return $.trim($("#instance").val());
}

function compose_message() {
    return $.trim($("#new_zephyr").val());
}

function compose_recipient() {
    return $.trim($("#recipient").val());
}

function compose_huddle_message() {
    return $.trim($("#new_personal_zephyr").val());
}

function compose_error(error_text, bad_input) {
    $('#send-status').removeClass(status_classes)
               .addClass('alert-error')
               .text(error_text)
               .stop(true).fadeTo(0, 1);
    $('#class-message, #personal-message').find('input[type="submit"]').removeAttr('disabled');
    bad_input.focus().select();
}

function submit_buttons() {
    return $('#class-message, #personal-message').find('input[type="submit"]');
}

// *Synchronously* check if a class exists.
// If not, displays an error and returns false.
function check_class_for_send(class_name) {
    var okay = true;
    $.ajax({
        url: "subscriptions/exists/" + class_name,
        async: false,
        success: function (data) {
            if (data === "False") {
                // The class doesn't exist
                okay = false;
                send_status.removeClass(status_classes);
                send_status.show();
                $('#class-dne-name').text(class_name);
                $('#class-dne').show();
                $('#create-it').focus();
                submit_buttons().removeAttr('disabled');
                hide_compose();
            }
            $("#home-error").hide();
        },
        error: function (xhr) {
            okay = false;
            report_error("Error checking subscription", xhr, $("#home-error"));
            $("#class").focus();
            submit_buttons().removeAttr('disabled');
        }
    });
    return okay;
}
{'fraction_non_alphanumeric': 0.19227482481627073, 'fraction_numerical': 0.0030763971970603314, 'mean_word_length': 2.883211678832117, 'pattern_counts': {'":': 4, '<': 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': '2733072', 'n_tokens_mistral': 1786, 'n_tokens_neox': 1746, 'n_words': 302}