<commit_before>var tswcalc = tswcalc || {};

tswcalc.import = function() {

    var start = function(vars) {
        for (var slotId in vars) {
            if (vars.hasOwnProperty(slotId)) {
                splitVars = vars[slotId].split(',');
                updateSlot(slotId, splitVars);
            }
        }
        tswcalc.summary.updateAllStats();
    };

    var updateSlot = function(slotId, values) {
        var slotObj = tswcalc.slots[slotId];
        slotObj.ql('10.' + values[0]);
        if(slotObj.isWeapon()) {
            slotObj.wtype(tswcalc.data.wtype_mapping.to_name[values[1]]);
            slotObj.el.wtype.change();
        } else {
            slotObj.role(tswcalc.data.role_mapping.to_stat[values[1]]);
        }
        slotObj.glyphQl('10.' + values[2]);
        slotObj.primaryGlyph(tswcalc.data.stat_mapping.to_stat[values[3]]);
        slotObj.secondaryGlyph(tswcalc.data.stat_mapping.to_stat[values[4]]);
        slotObj.el.btn.primary[values[5]].click();
        slotObj.el.btn.secondary[values[6]].click();
        // support signets
        if (typeof values[7] !== 'undefined' && typeof values[8] !== 'undefined') {
            if (values[8] >= 80) {
                slotObj.el.btn.nyraid.prop('disabled', false);
                slotObj.el.btn.nyraid.prop('checked', true);
                slotObj.el.btn.nyraid.change();
            } else {
                var signetQuality = tswcalc.data.signet_quality_mapping.to_name[values[7]];
                var signetId = values[8] != '0' ? values[8] : 'none';
                checkIfNyRaidItemAndEnableCheckButton(slotId);
                changeSignet(slotId, signetQuality, signetId);
            }
        } else {
            checkIfNyRaidItemAndEnableCheckButton(slotId);
            changeSignet(slotId, 'none', 'none');
        }
    };

    var checkIfNyRaidItemAndEnableCheckButton = function(slotId) {
        var slotObj = tswcalc.slots[slotId];
        if (isAllowedNyRaidItem(slotId)) {
            slotObj.el.btn.nyraid.prop('disabled', false);
        }
    };

    var changeSignet = function(slotId, quality, id) {
        var slotObj = tswcalc.slots[slotId];
        slotObj.signetQuality(quality);
        slotObj.signetId(id);
        slotObj.el.signetId.change();
    };

    var isAllowedNyRaidItem = function(slotId) {
        var slotObj = tswcalc.slots[slotId];
        return !slotObj.isWeapon() && typeof tswcalc.data.ny_raid_items[slotId][slotObj.role()] !== 'undefined';
    };

    var oPublic = {
        start: start
    };

    return oPublic;
}();<commit_msg>Fixed correct import of woodcutters<commit_after>var tswcalc = tswcalc || {};

tswcalc.import = function() {

    var start = function(vars) {
        for (var slotId in vars) {
            if (vars.hasOwnProperty(slotId)) {
                splitVars = vars[slotId].split(',');
                updateSlot(slotId, splitVars);
            }
        }
        tswcalc.summary.updateAllStats();
    };

    var updateSlot = function(slotId, values) {
        var slotObj = tswcalc.slots[slotId];
        slotObj.ql('10.' + values[0]);
        if(slotObj.isWeapon()) {
            slotObj.wtype(tswcalc.data.wtype_mapping.to_name[values[1]]);
            slotObj.el.wtype.change();
        } else {
            slotObj.role(tswcalc.data.role_mapping.to_stat[values[1]]);
        }
        slotObj.glyphQl('10.' + values[2]);
        slotObj.primaryGlyph(tswcalc.data.stat_mapping.to_stat[values[3]]);
        slotObj.secondaryGlyph(tswcalc.data.stat_mapping.to_stat[values[4]]);
        slotObj.el.btn.primary[values[5]].click();
        slotObj.el.btn.secondary[values[6]].click();
        // support signets
        if (typeof values[7] !== 'undefined' && typeof values[8] !== 'undefined') {
            if(values[8] >= 90) {
                slotObj.el.btn.woodcutters.prop('disabled', false);
                slotObj.el.btn.woodcutters.prop('checked', true);
                slotObj.el.btn.woodcutters.change();
            } else if (values[8] >= 80 && values[8] < 90) {
                slotObj.el.btn.nyraid.prop('disabled', false);
                slotObj.el.btn.nyraid.prop('checked', true);
                slotObj.el.btn.nyraid.change();
            } else {
                var signetQuality = tswcalc.data.signet_quality_mapping.to_name[values[7]];
                var signetId = values[8] != '0' ? values[8] : 'none';
                changeSignet(slotId, signetQuality, signetId);
            }
        } else {
            changeSignet(slotId, 'none', 'none');
        }
        checkIfNyRaidItemAndEnableCheckButton(slotId);
        checkIfWoodcutterNecklaceAndEnableCheckbutton(slotId);
    };

    var checkIfNyRaidItemAndEnableCheckButton = function(slotId) {
        var slotObj = tswcalc.slots[slotId];
        if (isAllowedNyRaidItem(slotId)) {
            slotObj.el.btn.nyraid.prop('disabled', false);
        }
    };

    var checkIfWoodcutterNecklaceAndEnableCheckbutton = function(slotId) {
        if(slotId == "neck") {
            var slotObj = tswcalc.slots[slotId];
            slotObj.el.btn.woodcutters.prop('disabled', false);
        }
    };

    var changeSignet = function(slotId, quality, id) {
        var slotObj = tswcalc.slots[slotId];
        slotObj.signetQuality(quality);
        slotObj.signetId(id);
        slotObj.el.signetId.change();
    };

    var isAllowedNyRaidItem = function(slotId) {
        var slotObj = tswcalc.slots[slotId];
        return !slotObj.isWeapon() && typeof tswcalc.data.ny_raid_items[slotId][slotObj.role()] !== 'undefined';
    };

    var oPublic = {
        start: start
    };

    return oPublic;
}();
{'fraction_non_alphanumeric': 0.14058355437665782, 'fraction_numerical': 0.008488063660477453, 'mean_word_length': 2.241260744985673, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '5694991', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1809, 'n_words': 252}