<commit_before>//
// Emulation of the Google Gadget JavaScript API.
//
// Author: <NAME> <<EMAIL>>
//

function _IG_Prefs(widget) {
    if (typeof(widget) == "object")
        this.widget = widget;
    else
        rootWidget.getWidget(widget);
    this.values = new Array();

    if (this.widget._query_string != null) {
        values = this.widget._query_string.split('&');
        for (i in values) {
            var key = values[i], value;
            i = key.indexOf('=');
            if (i >= 0) {
                value = key.substring(i + 1);
                key = key.substring(0, i);
            } else
                value = "";
            this.values[unescape(key)] = unescape(value);
        }
    }

    this.getInt = function(name) {
        return parseInt(this.getString(name));
    }

    this.getBool = function(name) {
        var value = this.getString(name);
        return value == "1" || value == "yes" || value == "true";
    }

    this.getString = function(name) {
        return this.values[name];
    }

    this.set = function(name, value) {
        this.values[name] = value;
        this.widget.get("?" + escape(name) + "=" + escape(value), null, true);<commit_msg>added _IG_Prefs.getArray()<commit_after>//
// Emulation of the Google Gadget JavaScript API.
//
// Author: <NAME> <<EMAIL>>
//

function _IG_Prefs(widget) {
    if (typeof(widget) == "object")
        this.widget = widget;
    else
        rootWidget.getWidget(widget);
    this.values = new Array();

    if (this.widget._query_string != null) {
        values = this.widget._query_string.split('&');
        for (i in values) {
            var key = values[i], value;
            i = key.indexOf('=');
            if (i >= 0) {
                value = key.substring(i + 1);
                key = key.substring(0, i);
            } else
                value = "";
            this.values[unescape(key)] = unescape(value);
        }
    }

    this.getInt = function(name) {
        return parseInt(this.getString(name));
    }

    this.getBool = function(name) {
        var value = this.getString(name);
        return value == "1" || value == "yes" || value == "true";
    }

    this.getString = function(name) {
        return this.values[name];
    }

    this.getArray = function(name) {
        var value = new Array();
        // XXX
        return value;
    }

    this.set = function(name, value) {
        this.values[name] = value;
        this.widget.get("?" + escape(name) + "=" + escape(value), null, true);
{'fraction_non_alphanumeric': 0.15762376237623762, 'fraction_numerical': 0.0031683168316831685, 'mean_word_length': 1.8934707903780068, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '4696696', 'n_tokens_mistral': 783, 'n_tokens_neox': 767, 'n_words': 171}