<commit_before>define('app/models/key', [
    'ember'
    ],
    /**
     * Key model
     *
     * @returns Class
     */
    function() {
        return Ember.Object.extend({
            name: null,
            pub: null,
            priv: null,
            machines: null,
            default_key: null,

            id: function() {
               return this.name;
            }.property("name"),

            deleteKey: function() {
                payload = {
                    'key_name': this.name
                }
                var that = this
                $.ajax({
                    url: 'keys/' + that.name,
                    type: 'DELETE',
                    contentType: 'application/json',
                    data: JSON.stringify(payload),
                    success: function(data) {
                        info('Successfully deleted key', that.name);
                        Mist.keysController.updateKeyList(data);
                        Ember.run.next(function() {
                            $('#keys-list').listview('refresh');
                            $('#keys-list .ember-checkbox').checkboxradio();
                        });
                    },
                    error: function(jqXHR, textstate, errorThrown) {
                        Mist.notificationController.notify('Error while deleting key '  +
                                that.name);
                        error(textstate, errorThrown, 'while deleting key', that.name);
                    }
                });
            },

            setDefaultKey: function(){
                payload = {
                    'action': 'set_default',
                    'key_name': this.name,
                }
                var that = this
                $.ajax({
                    url: '/keys',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify(payload),
                    success: function(data) {
                        info('Successfully set key', that.name, 'as default');
                        var keys = new Array();
                        Mist.keysController.forEach(function(key){
                            key.set('default_key', false);
                        });
                        that.set('default_key', true);
                        Ember.run.next(function(){$('#keys-list').listview('refresh')});
                    },
                    error: function(jqXHR, textstate, errorThrown) {
                        Mist.notificationController.notify('Error while setting key '  +
                                that.name + ' as default');
                        error(textstate, errorThrown, 'while setting default key', that.name);
                    }
                });
            },
        });
    }<commit_msg>Delete unused variable<commit_after>define('app/models/key', [
    'ember'
    ],
    /**
     * Key model
     *
     * @returns Class
     */
    function() {
        return Ember.Object.extend({
            name: null,
            pub: null,
            priv: null,
            machines: null,
            default_key: null,

            id: function() {
               return this.name;
            }.property("name"),

            deleteKey: function() {
                payload = {
                    'key_name': this.name
                }
                var that = this
                $.ajax({
                    url: 'keys/' + that.name,
                    type: 'DELETE',
                    contentType: 'application/json',
                    data: JSON.stringify(payload),
                    success: function(data) {
                        info('Successfully deleted key', that.name);
                        Mist.keysController.updateKeyList(data);
                        Ember.run.next(function() {
                            $('#keys-list').listview('refresh');
                            $('#keys-list .ember-checkbox').checkboxradio();
                        });
                    },
                    error: function(jqXHR, textstate, errorThrown) {
                        Mist.notificationController.notify('Error while deleting key '  +
                                that.name);
                        error(textstate, errorThrown, 'while deleting key', that.name);
                    }
                });
            },

            setDefaultKey: function(){
                payload = {
                    'action': 'set_default',
                    'key_name': this.name,
                }
                var that = this
                $.ajax({
                    url: '/keys',
                    type: 'POST',
                    contentType: 'application/json',
                    data: JSON.stringify(payload),
                    success: function(data) {
                        info('Successfully set key', that.name, 'as default');
                        Mist.keysController.forEach(function(key){
                            key.set('default_key', false);
                        });
                        that.set('default_key', true);
                        Ember.run.next(function(){$('#keys-list').listview('refresh')});
                    },
                    error: function(jqXHR, textstate, errorThrown) {
                        Mist.notificationController.notify('Error while setting key '  +
                                that.name + ' as default');
                        error(textstate, errorThrown, 'while setting default key', that.name);
                    }
                });
            },
        });
    }
{'fraction_non_alphanumeric': 0.11136726369923745, 'fraction_numerical': 0.0, 'mean_word_length': 0.9706498951781971, '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': '4540963', 'n_tokens_mistral': 1306, 'n_tokens_neox': 1217, 'n_words': 244}