<commit_before>define('app/models/backend', ['app/controllers/machines', 'app/controllers/images', 'app/controllers/sizes',
                              'app/controllers/locations','app/controllers/networks', 'ember'],
    /**
     *  Backend Model
     *
     *  @returns Class
     */
    function (MachinesController, ImagesController, SizesController,
        LocationsController, NetworksController) {
        return Ember.Object.extend(Ember.Evented, {

            /**
             *  Properties
             */

            id: null,
            host: null,
            state: null,
            title: null,
            apikey: null,
            enabled: null,
            provider: null,
            poll_interval: null,
            create_pending: null,
            selectedMachines: [],
            selectedNetworks: [],

            sizes: null,
            images: null,
            machines: null,
            locations: null,
            networks: null,

            sizeCount: 0,
            imageCount: 0,
            machineCount: 0,
            networkCount: 0,
            locationCoount: 0,

            loadingSizes: null,
            loadingImages: null,
            loadingMachines: null,
            loadingLocations: null,
            loadingNetworks: null,

            isOpenStack: function () {
                return this.provider == 'openstack';
            }.property('provider'),

            isNephoscale: function () {
                return this.provider == 'nephoscale';
            }.property('provider'),

            hasNetworks: function () {
                return this.provider == 'openstack' || this.provider == 'nephoscale' ||
                    this.provider == 'azure' || this.provider == 'vcloud' || this.provider == 'ec2';
            }.property('provider'),

            /**
             *
             *  Initialization
             *
             */

            load: function () {

                Ember.run(this, function () {

                    this.set('isBareMetal', this.provider == 'bare_metal');

                    // Add controllers
                    this.sizes = SizesController.create({backend: this, content: []});
                    this.images = ImagesController.create({backend: this, content: []});
                    this.machines = MachinesController.create({backend: this, content: []});
                    this.locations = LocationsController.create({backend: this, content: []});
                    this.networks = NetworksController.create({backend: this, content: []});

                    // Add events
                    this.sizes.on('onSizeListChange', this, '_updateSizeCount');
                    this.images.on('onImageListChange', this, '_updateImageCount');
                    this.machines.on('onMachineListChange', this, '_updateMachineCount');
                    this.locations.on('onLocationListChange', this, '_updateLocationCount');
                    this.networks.on('onNetworkListChange', this, '_updateNetworkCount');
                    this.machines.on('onSelectedMachinesChange', this, '_updateSelectedMachines');
                    this.networks.on('onSelectedNetworksChange', this, '_updateSelectedNetworks');

                    // Add observers
                    this.sizes.addObserver('loading', this, function () {
                        Ember.run.once(this, 'loadingSizesObserver');
                    });
                    this.images.addObserver('loading', this, function () {
                        Ember.run.once(this, 'loadingImagesObserver');<commit_msg>Fix onChange event for networks<commit_after>define('app/models/backend', ['app/controllers/machines', 'app/controllers/images', 'app/controllers/sizes',
                              'app/controllers/locations','app/controllers/networks', 'ember'],
    /**
     *  Backend Model
     *
     *  @returns Class
     */
    function (MachinesController, ImagesController, SizesController,
        LocationsController, NetworksController) {
        return Ember.Object.extend(Ember.Evented, {

            /**
             *  Properties
             */

            id: null,
            host: null,
            state: null,
            title: null,
            apikey: null,
            enabled: null,
            provider: null,
            poll_interval: null,
            create_pending: null,
            selectedMachines: [],
            selectedNetworks: [],

            sizes: null,
            images: null,
            machines: null,
            locations: null,
            networks: null,

            sizeCount: 0,
            imageCount: 0,
            machineCount: 0,
            networkCount: 0,
            locationCoount: 0,

            loadingSizes: null,
            loadingImages: null,
            loadingMachines: null,
            loadingLocations: null,
            loadingNetworks: null,

            isOpenStack: function () {
                return this.provider == 'openstack';
            }.property('provider'),

            isNephoscale: function () {
                return this.provider == 'nephoscale';
            }.property('provider'),

            hasNetworks: function () {
                return this.provider == 'openstack' || this.provider == 'nephoscale' ||
                    this.provider == 'azure' || this.provider == 'vcloud' || this.provider == 'ec2';
            }.property('provider'),

            /**
             *
             *  Initialization
             *
             */

            load: function () {

                Ember.run(this, function () {

                    this.set('isBareMetal', this.provider == 'bare_metal');

                    // Add controllers
                    this.sizes = SizesController.create({backend: this, content: []});
                    this.images = ImagesController.create({backend: this, content: []});
                    this.machines = MachinesController.create({backend: this, content: []});
                    this.locations = LocationsController.create({backend: this, content: []});
                    this.networks = NetworksController.create({backend: this, content: []});

                    // Add events
                    this.sizes.on('onSizeListChange', this, '_updateSizeCount');
                    this.images.on('onImageListChange', this, '_updateImageCount');
                    this.machines.on('onMachineListChange', this, '_updateMachineCount');
                    this.locations.on('onLocationListChange', this, '_updateLocationCount');
                    this.networks.on('onChange', this, '_updateNetworkCount');
                    this.machines.on('onSelectedMachinesChange', this, '_updateSelectedMachines');
                    this.networks.on('onSelectedNetworksChange', this, '_updateSelectedNetworks');

                    // Add observers
                    this.sizes.addObserver('loading', this, function () {
                        Ember.run.once(this, 'loadingSizesObserver');
                    });
                    this.images.addObserver('loading', this, function () {
                        Ember.run.once(this, 'loadingImagesObserver');
{'fraction_non_alphanumeric': 0.11653455708524545, 'fraction_numerical': 0.001668752607425949, 'mean_word_length': 1.5805525654825978, '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': '4882019', 'n_tokens_mistral': 1801, 'n_tokens_neox': 1677, 'n_words': 323}