<commit_before>var Widget = require("widget").Widget;
var Panel = require("panel").Panel;
var data = require("self").data;
var storage = require("simple-storage").storage;
var prefSet = require("simple-prefs");

exports.main = function() {
    var openPrefs = function () {
        require('window-utils').activeBrowserWindow.BrowserOpenAddonsMgr("addons://detail/"+require("self").id);
    }
    if (storage.prefs === undefined) {
        storage.prefs = {};
    }
    storage.prefs.githubUsername = prefSet.prefs.githubUsername;
    storage.prefs.refreshRate = prefSet.prefs.refreshRate;

    var prefHandler = function(prefName) {
        storage.prefs[prefName] = prefSet.prefs[prefName];
    };
    prefSet.on("githubUsername", prefHandler);
    prefSet.on("refreshRate", prefHandler);
    var panel = Panel({
        contentURL: data.url("panel.html")
    });
    panel.on('show', function() {
        panel.port.emit("show", storage);
    });
    panel.port.on('log', function(message) {
        console.log(message);
    });
    panel.port.on('store', function(message) {
        message.forEach(function(element) {
            storage[element.key] = element.value;
        });
    });
    panel.port.on('refresh', function() {
        console.log('refresh');
        panel.port.emit("show", storage);
    });
    panel.port.on('openPrefs', function() {
        openPrefs();
    });

    new Widget({
        id: "github-repo-widget",
        label: "Github Repo Widget",
        contentURL: data.url("github.ico"),
        panel: panel
    });
};

console.log("The add-on is running.");
<commit_msg>cleanup<commit_after>var Widget = require("widget").Widget;
var Panel = require("panel").Panel;
var data = require("self").data;
var storage = require("simple-storage").storage;
var prefSet = require("simple-prefs");

exports.main = function() {
    var openPrefs = function () {
        require('window-utils').activeBrowserWindow.BrowserOpenAddonsMgr(
            "addons://detail/"+require("self").id
        );
    }
    if (storage.prefs === undefined) {
        storage.prefs = {};
    }
    storage.prefs.githubUsername = prefSet.prefs.githubUsername;
    storage.prefs.refreshRate = prefSet.prefs.refreshRate;

    var prefHandler = function(prefName) {
        storage.prefs[prefName] = prefSet.prefs[prefName];
    };
    prefSet.on("githubUsername", prefHandler);
    prefSet.on("refreshRate", prefHandler);
    var panel = Panel({
        contentURL: data.url("panel.html")
    });
    panel.on('show', function() {
        panel.port.emit("show", storage);
    });
    panel.port.on('log', function(message) {
        console.log(message);
    });
    panel.port.on('store', function(message) {
        message.forEach(function(element) {
            storage[element.key] = element.value;
        });
    });
    panel.port.on('refresh', function() {
        console.log('refresh');
        panel.port.emit("show", storage);
    });
    panel.port.on('openPrefs', function() {
        openPrefs();
    });

    new Widget({
        id: "github-repo-widget",
        label: "Github Repo Widget",
        contentURL: data.url("github.ico"),
        panel: panel
    });
};

console.log("The add-on is running.");

{'fraction_non_alphanumeric': 0.16893564356435645, 'fraction_numerical': 0.0, 'mean_word_length': 2.881152460984394, 'pattern_counts': {'":': 0, '<': 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': '2788966', 'n_tokens_mistral': 968, 'n_tokens_neox': 985, 'n_words': 159}