<commit_before>// wrapper for localStorage, sessionStorage and document.cookie
var Vault = (function() {
    var _parse = function(_value) {
        // everything in local storage is a string
        // so let's convert booleans and numbers
        // to be true booleans and numbers
        // and return those
        if (_value===null || _value===undefined) {
            // localStorage["foo"] returns null
            // in some browsers even if 
            // foo isn't there at all.
            // since foo is really undefined,
            // we are returning accordingly
            return undefined;
        }
        if (_value==="true") {
            return true;
        }
        if (_value==="false") {
            return false;
        }
        if (!isNaN(_value)) {
            return parseFloat(_value);
        }
        if (_value.indexOf && (_value.indexOf("{")===0 || _value.indexOf("[")===0) && window.JSON!==undefined) {
            return JSON.parse(_value);
        }
        return _value;
    };
    var _prepare = function(_value) {
        if (typeof _value==="object" && window.JSON!==undefined) {
            return JSON.stringify(_value);
        }
        return _value;
    };
    var _notSupported = function() {
        return undefined;
    };
    var _trim = function(_str) {
        if (!isNaN(_str)) {
            return _str;
        }
        _str = _str.replace(/^\s\s*/, '');
        var _ws = /\s/;
        var _i = _str.length;
        while (_ws.test(_str.charAt(--_i)));
        return _str.slice(0, _i + 1);
    };
    var _prepareSqlValue = function(_value) {
        if (isNaN(_value) && _value.indexOf('"')<0) {
            _value = '"' + _trim(_value) + '"';
        }
        return _value;
    };
    var _parseKeyValueList = function(_pair) {
        var _key, _fields=[], _values=[];
        for (_key in _pair) {
            if (!_key.match(/^\_/)) {
                _fields.push(_key);
                _values.push(_prepareSqlValue(_pair[_key]));
            }
        }
        return {
            fields: _fields,
            values: _values
        };
    };
    var _setup = function(_type) {
        var _storage = window[_type];
        if (_storage===undefined) {
            return {
                get: _notSupported,
                set: _notSupported,
                remove: _notSupported,
                clear: _notSupported,
                list: _notSupported,
                isSupported: function() { return false; }
            }
        }
        return {<commit_msg>don't need that trim function anymore<commit_after>// wrapper for localStorage, sessionStorage and document.cookie
var Vault = (function() {
    var _parse = function(_value) {
        // everything in local storage is a string
        // so let's convert booleans and numbers
        // to be true booleans and numbers
        // and return those
        if (_value===null || _value===undefined) {
            // localStorage["foo"] returns null
            // in some browsers even if 
            // foo isn't there at all.
            // since foo is really undefined,
            // we are returning accordingly
            return undefined;
        }
        if (_value==="true") {
            return true;
        }
        if (_value==="false") {
            return false;
        }
        if (!isNaN(_value)) {
            return parseFloat(_value);
        }
        if (_value.indexOf && (_value.indexOf("{")===0 || _value.indexOf("[")===0) && window.JSON!==undefined) {
            return JSON.parse(_value);
        }
        return _value;
    };
    var _prepare = function(_value) {
        if (typeof _value==="object" && window.JSON!==undefined) {
            return JSON.stringify(_value);
        }
        return _value;
    };
    var _notSupported = function() {
        return undefined;
    };
    var _prepareSqlValue = function(_value) {
        if (isNaN(_value) && _value.indexOf('"')<0) {
            _value = '"' + _value + '"';
        }
        return _value;
    };
    var _parseKeyValueList = function(_pair) {
        var _key, _fields=[], _values=[];
        for (_key in _pair) {
            if (!_key.match(/^\_/)) {
                _fields.push(_key);
                _values.push(_prepareSqlValue(_pair[_key]));
            }
        }
        return {
            fields: _fields,
            values: _values
        };
    };
    var _setup = function(_type) {
        var _storage = window[_type];
        if (_storage===undefined) {
            return {
                get: _notSupported,
                set: _notSupported,
                remove: _notSupported,
                clear: _notSupported,
                list: _notSupported,
                isSupported: function() { return false; }
            }
        }
        return {
{'fraction_non_alphanumeric': 0.12531017369727046, 'fraction_numerical': 0.0016542597187758478, 'mean_word_length': 1.531135531135531, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7068006', 'n_tokens_mistral': 1319, 'n_tokens_neox': 1293, 'n_words': 332}