<commit_before>(function() {
    /* Call this with something like $('.install').installButton(); */
    z.button = {};

    /* A library of callbacks that may be run after InstallTrigger succeeds.
     * ``this`` will be bound to the .install button.
     */
    z.button.after = {'contrib': function(xpi_url, status) {
        if (status === 0) { //success
            document.location = $(this).attr('data-developers');
        }
    }};

    /* Install an XPI or a JAR (or something like that).
     *
     * hash and callback are optional.  callback is triggered after the
     * installation is complete.
     */
    z.installAddon = function(name, url, icon, hash, callback) {
        var params = {};
        params[name] = {
            URL: url,
            IconURL: icon,
            toString: function() { return url; }
        };
        if (hash) {
            params[name]['Hash'] = hash;
        }
        // InstallTrigger is a Gecko API.
        InstallTrigger.install(params, callback);
        _gaq.push(['_trackEvent', 'AMO Addon / Theme Installs', 'addon', name]);
    };

    z.installSearch = function(name, url, icon, hash, callback) {
        if (window.external && window.external.AddSearchProvider) {
            window.external.AddSearchProvider(url);
            callback();
            _gaq.push(['_trackEvent', 'AMO Addon / Theme Installs', 'addon', name]);
        } else {
            // Alert!  Deal with it.
            alert(gettext('Sorry, you need a Mozilla-based browser (such as Firefox) to install a search plugin.'));
        }
    };

    var data_purchases = $('body').attr('data-purchases') || "",
        addons_purchased = $.map(data_purchases.split(','),
                                 function(v) { return parseInt(v, 10); });

    var messages = {
        'tooNew': format(gettext("Not Updated for {0} {1}"), z.appName, z.browserVersion),
        'tooOld': format(gettext("Requires Newer Version of {0}"), z.appName),
        'unreviewed': gettext("Unreviewed"),
        'lite': gettext("Experimental <span>(Learn More)</span>"),
        'badApp': format(gettext("Not Available for {0}"), z.appName),
        'badPlatform': format(gettext("Not Available for {0}"), z.platformName),
        'experimental': gettext("Experimental"),
        'personasTooOld': format(gettext("Themes Require Newer Version of {0}"), z.appName),
        'personasLearnMore': format(gettext("Themes Require {0}"), z.appName)
    };
<commit_msg>Call callback only when passed<commit_after>(function() {
    /* Call this with something like $('.install').installButton(); */
    z.button = {};

    /* A library of callbacks that may be run after InstallTrigger succeeds.
     * ``this`` will be bound to the .install button.
     */
    z.button.after = {'contrib': function(xpi_url, status) {
        if (status === 0) { //success
            document.location = $(this).attr('data-developers');
        }
    }};

    /* Install an XPI or a JAR (or something like that).
     *
     * hash and callback are optional.  callback is triggered after the
     * installation is complete.
     */
    z.installAddon = function(name, url, icon, hash, callback) {
        var params = {};
        params[name] = {
            URL: url,
            IconURL: icon,
            toString: function() { return url; }
        };
        if (hash) {
            params[name]['Hash'] = hash;
        }
        // InstallTrigger is a Gecko API.
        InstallTrigger.install(params, callback);
        _gaq.push(['_trackEvent', 'AMO Addon / Theme Installs', 'addon', name]);
    };

    z.installSearch = function(name, url, icon, hash, callback) {
        if (window.external && window.external.AddSearchProvider) {
            window.external.AddSearchProvider(url);
            if (callback && typeof callback === 'function') {
                callback();
            }
            _gaq.push(['_trackEvent', 'AMO Addon / Theme Installs', 'addon', name]);
        } else {
            // Alert!  Deal with it.
            alert(gettext('Sorry, you need a Mozilla-based browser (such as Firefox) to install a search plugin.'));
        }
    };

    var data_purchases = $('body').attr('data-purchases') || "",
        addons_purchased = $.map(data_purchases.split(','),
                                 function(v) { return parseInt(v, 10); });

    var messages = {
        'tooNew': format(gettext("Not Updated for {0} {1}"), z.appName, z.browserVersion),
        'tooOld': format(gettext("Requires Newer Version of {0}"), z.appName),
        'unreviewed': gettext("Unreviewed"),
        'lite': gettext("Experimental <span>(Learn More)</span>"),
        'badApp': format(gettext("Not Available for {0}"), z.appName),
        'badPlatform': format(gettext("Not Available for {0}"), z.platformName),
        'experimental': gettext("Experimental"),
        'personasTooOld': format(gettext("Themes Require Newer Version of {0}"), z.appName),
        'personasLearnMore': format(gettext("Themes Require {0}"), z.appName)
    };

{'fraction_non_alphanumeric': 0.1504459861248761, 'fraction_numerical': 0.003964321110009911, 'mean_word_length': 2.3820375335120643, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3500982', 'n_tokens_mistral': 1478, 'n_tokens_neox': 1426, 'n_words': 391}