<commit_before>var available_pins = [2];

var socket = io.connect();

socket.on('drawPinState', function (data) {
    if (data.val === "1") {
        document.getElementById('pin_' + data.pin).parentNode.className += " is-checked";
        document.getElementById('pin_' + data.pin).checked = "checked";
    } else {
        document.getElementById('pin_' + data.pin).parentNode.className = document.getElementById('pin_' + data.pin).parentNode.className.replace(" is-checked", "");
        document.getElementById('pin_' + data.pin).checked = "";
    }
});

function setValue(me) {
    var pin = me.getAttribute('data-pin')
    var value = me.parentNode.className.indexOf("is-checked") > -1 ? 0 : 1;

    socket.emit('set', {pin: pin, val: value});
}

function pinState(pin) {
    socket.emit('read', {pin: pin});
}

function onLoad() {
    for (x in available_pins) {
        pinState(available_pins[x]);
    }<commit_msg>prevent default2<commit_after>var available_pins = [2];

var socket = io.connect();

socket.on('drawPinState', function (data) {
    if (data.val === "1") {
        document.getElementById('pin_' + data.pin).parentNode.className += " is-checked";
        document.getElementById('pin_' + data.pin).checked = "checked";
    } else {
        document.getElementById('pin_' + data.pin).parentNode.className = document.getElementById('pin_' + data.pin).parentNode.className.replace(" is-checked", "");
        document.getElementById('pin_' + data.pin).checked = "";
    }
});

function setValue(me) {
    var pin = me.getAttribute('data-pin')
    var value = me.parentNode.className.indexOf("is-checked") > -1 ? 0 : 1;

    socket.emit('set', {pin: pin, val: value});
    event.preventDefault();
}

function pinState(pin) {
    socket.emit('read', {pin: pin});
}

function onLoad() {
    for (x in available_pins) {
        pinState(available_pins[x]);
    }
{'fraction_non_alphanumeric': 0.17881852048962213, 'fraction_numerical': 0.005854177754124534, 'mean_word_length': 3.5853658536585367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7618552', 'n_tokens_mistral': 589, 'n_tokens_neox': 588, 'n_words': 110}