<commit_before>isic.views.FeaturesetView = isic.View.extend({
    events: {
        'click .isic-featureset-destroy-button': 'confirmDestroy'
    },

    /**
     * @param {isic.models.FeaturesetModel} settings.model
     */
    initialize: function (settings) {
        // Display loading indicator
        this.loadingAnimation = new girder.views.LoadingAnimation({
            el: this.el,
            parentView: this
        }).render();

        this.model.once('g:fetched', function () {
            // Don't "this.loadingAnimation.destroy()", as it will unbind all events on "this.el"
            delete this.loadingAnimation;

            this.render();
        }, this).fetch();
    },

    render: function () {
        this.$el.html(isic.templates.featuresetPage({
            featureset: this.model,
            currentUser: girder.currentUser
        }));

        return this;
    },

    confirmDestroy: function () {
        girder.confirm({
            text: '<h4>Permanently delete <b>"' + _.escape(this.model.name()) + '"</b> featureset?</h4>',
            escapedHtml: true,
            confirmCallback: _.bind(function () {
                // Ensure dialog is hidden before continuing. Otherwise,
                // when destroy() displays its modal alert dialog,
                // the Bootstrap-created element with class "modal-backdrop"
                // is erroneously not removed.
                $('#g-dialog-container').on('hidden.bs.modal', _.bind(this.destroy, this));
            }, this)
        });
    },

    destroy: function () {
        this.model.destroy({
            success: function (model, resp, options) {
                isic.showAlertDialog({
                    text: '<h4>Featureset <b>"' + _.escape(model.name()) + '"</b> deleted</h4>',
                    escapedHtml: true
                });<commit_msg>Rename FeaturesetView.destroy to not conflict with girder.destroy<commit_after>isic.views.FeaturesetView = isic.View.extend({
    events: {
        'click .isic-featureset-destroy-button': 'confirmDestroy'
    },

    /**
     * @param {isic.models.FeaturesetModel} settings.model
     */
    initialize: function (settings) {
        // Display loading indicator
        this.loadingAnimation = new girder.views.LoadingAnimation({
            el: this.el,
            parentView: this
        }).render();

        this.model.once('g:fetched', function () {
            // Don't "this.loadingAnimation.destroy()", as it will unbind all events on "this.el"
            delete this.loadingAnimation;

            this.render();
        }, this).fetch();
    },

    render: function () {
        this.$el.html(isic.templates.featuresetPage({
            featureset: this.model,
            currentUser: girder.currentUser
        }));

        return this;
    },

    confirmDestroy: function () {
        girder.confirm({
            text: '<h4>Permanently delete <b>"' + _.escape(this.model.name()) + '"</b> featureset?</h4>',
            escapedHtml: true,
            confirmCallback: _.bind(function () {
                // Ensure dialog is hidden before continuing. Otherwise,
                // when destroy() displays its modal alert dialog,
                // the Bootstrap-created element with class "modal-backdrop"
                // is erroneously not removed.
                $('#g-dialog-container').on('hidden.bs.modal', _.bind(this.destroyModel, this));
            }, this)
        });
    },

    destroyModel: function () {
        this.model.destroy({
            success: function (model, resp, options) {
                isic.showAlertDialog({
                    text: '<h4>Featureset <b>"' + _.escape(model.name()) + '"</b> deleted</h4>',
                    escapedHtml: true
                });
{'fraction_non_alphanumeric': 0.1365079365079365, 'fraction_numerical': 0.0021164021164021165, 'mean_word_length': 1.8407212622088656, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2639287', 'n_tokens_mistral': 1019, 'n_tokens_neox': 992, 'n_words': 220}