<commit_before>define('app/controllers/sizes', ['app/models/size'],
    //
    //  Sizes Controller
    //
    //  @returns Class
    //
    function (Size) {

        'use strict';

        return Ember.ArrayController.extend(Ember.Evented, {


            //
            //
            //  Properties
            //
            //


            content: null,
            loading: null,
            backend: null,


            //
            //
            //  Initialization
            //
            //


            init: function () {
                this._super();
                this.set('content', []);
                this.set('loading', true);
            },


            //
            //
            //  Methods
            //
            //


            load: function (sizes) {
                this._updateContent(sizes);
                this.set('loading', false);
            },


            getSize: function (sizeId) {
                return this.content.findBy('id', sizeId);
            },


            //
            //
            //  Pseudo-Private Methods
            //
            //


            _updateContent: function (sizes) {
                Ember.run(this, function() {

                    // Remove deleted sizes
                    this.content.forEach(function (size) {
                        if (!sizes.findBy('id', size.id))
                            this.content.removeObject(size);
                    }, this);

                    sizes.forEach(function (size) {

                        var oldSize = this.getSize(size.id);

                        if (oldSize)
                            // Update existing sizes
                            forIn(size, function (value, property) {
                                oldSize.set(property, value);
                            });
                        else
                            // Add new sizes
                            this._addSize(size);
                    }, this);

                    this.trigger('onSizeListChange');
                });
            },


            _addSize: function (size) {
                Ember.run(this, function() {
                    this.content.pushObject(Size.create(size));
                    this.trigger('onSizeAdd');
                });
            },


            _deleteSize: function (sizeId) {
                Ember.run(this, function() {
                    this.content.removeObject(this.getSize(sizeId));
                    this.trigger('onSizeDelete');
                });
            }
        });
    }
);<commit_msg>code style fixes<commit_after>define('app/controllers/sizes', ['app/models/size'],
    //
    //  Sizes Controller
    //
    //  @returns Class
    //
    function (Size) {

        'use strict';

        return Ember.ArrayController.extend(Ember.Evented, {


            //
            //
            //  Properties
            //
            //


            content: null,
            loading: null,
            backend: null,


            //
            //
            //  Initialization
            //
            //


            init: function () {
                this._super();
                this.set('content', []);
                this.set('loading', true);
            },


            //
            //
            //  Methods
            //
            //


            load: function (sizes) {
                this._updateContent(sizes);
                this.set('loading', false);
            },


            getSize: function (sizeId) {
                return this.content.findBy('id', sizeId);
            },


            //
            //
            //  Pseudo-Private Methods
            //
            //


            _updateContent: function (sizes) {
                Ember.run(this, function () {

                    // Remove deleted sizes
                    this.content.forEach(function (size) {
                        if (!sizes.findBy('id', size.id))
                            this.content.removeObject(size);
                    }, this);

                    sizes.forEach(function (size) {

                        var oldSize = this.getSize(size.id);

                        if (oldSize)
                            // Update existing sizes
                            forIn(size, function (value, property) {
                                oldSize.set(property, value);
                            });
                        else
                            // Add new sizes
                            this._addSize(size);
                    }, this);

                    this.trigger('onSizeListChange');
                });
            },


            _addSize: function (size) {
                Ember.run(this, function () {
                    this.content.pushObject(Size.create(size));
                    this.trigger('onSizeAdd');
                });
            },


            _deleteSize: function (sizeId) {
                Ember.run(this, function () {
                    this.content.removeObject(this.getSize(sizeId));
                    this.trigger('onSizeDelete');
                });
            }
        });
    }
);
{'fraction_non_alphanumeric': 0.11312741312741313, 'fraction_numerical': 0.0, 'mean_word_length': 0.7939750692520776, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3009692', 'n_tokens_mistral': 1274, 'n_tokens_neox': 1156, 'n_words': 188}