<commit_before>+function(){

    var module = angular.module('sizeSelector', [

        // No dependencies being used...

    ]);

    module.directive('sizeSelector', function(){

        return {

            link : function($scope, $element, $attributes){

                $scope.$watch('model', function(newValue, oldValue){

                    if(newValue != oldValue){

                        $scope.$parent.$eval($attributes.onChange);

                    }

                });

                $scope.changeSize = function(increase){

                    if($scope.model == null){

                        $scope.model = 0;

                    }
                    else{

                        $scope.model = Math.max(0, Math.min($scope.sizes.length - 1, $scope.model + increase));

                    }

                };

            },

            replace : true,

            restrict : 'E',

            scope : {

                default : '=',

                large : '=',

                model : '=',
                
                sizes : '='

            },

            template : [

                '<div class="bpb-size-selector">',
                    '<div ng-show="sizes.length > 0">',
                        '<button class="bpb-size-selector-button bpb-size-selector-button-minus ng-class: {\'disabled\' : (model == 0), \'bpb-size-selector-button-large\' : large}" type="button" ng-disabled="model == 0" ng-click="changeSize(-1)">-</button>',
                        '<button class="bpb-size-selector-button bpb-size-selector-button-plus ng-class: {disabled: model == sizes.length - 1, \'bpb-size-selector-button-large\' : large}" type="button" ng-disabled="model == sizes.length - 1" ng-click="changeSize(1)">+</button>',
                        '<div class="bpb-size-selector-available-sizes">',
                            '<p ng-show="model == null">&nbsp;</p>',
                            '<p ng-repeat="size in sizes" ng-show="$index == model">{{size.size_no}}</p>',
                        '</div>',
                        '<span class="bpb-size-selector-size-changed blue" ng-show="model != default">',
                            'size changed<br>',
                            '<span ng-show="default">(default size is {{sizes[default].size_no}})</span>',
                            '<span ng-show="!default">(no default size)</span>',
                        '</span>',
                    '</div>',
                    '<div ng-show="sizes.length == 0"></div>',
                '</div>'

            ].join('')

        };

    });

}();<commit_msg>Default Value<commit_after>+function(){

    var module = angular.module('sizeSelector', [

        // No dependencies being used...

    ]);

    module.directive('sizeSelector', function(){

        return {

            link : function($scope, $element, $attributes){

                $scope.$watch('model', function(newValue, oldValue){

                    if(newValue != oldValue){

                        $scope.$parent.$eval($attributes.onChange);

                    }

                });

                $scope.changeSize = function(increase){

                    if($scope.model == null){

                        $scope.model = 0;

                    }
                    else{

                        $scope.model = Math.max(0, Math.min($scope.sizes.length - 1, $scope.model + increase));

                    }

                };

            },

            replace : true,

            restrict : 'E',

            scope : {

                default : '=',

                large : '=',

                model : '=',
                
                sizes : '='

            },

            template : [

                '<div class="bpb-size-selector">',
                    '<div ng-show="sizes.length > 0">',
                        '<button class="bpb-size-selector-button bpb-size-selector-button-minus ng-class: {\'disabled\' : (model == 0), \'bpb-size-selector-button-large\' : large}" type="button" ng-disabled="model == 0" ng-click="changeSize(-1)">-</button>',
                        '<button class="bpb-size-selector-button bpb-size-selector-button-plus ng-class: {disabled: model == sizes.length - 1, \'bpb-size-selector-button-large\' : large}" type="button" ng-disabled="model == sizes.length - 1" ng-click="changeSize(1)">+</button>',
                        '<div class="bpb-size-selector-available-sizes">',
                            '<p ng-show="model == null">&nbsp;</p>',
                            '<p ng-repeat="size in sizes" ng-show="$index == model">{{size.size_no}}</p>',
                        '</div>',
                        '<span class="bpb-size-selector-size-changed blue" ng-show="model != default">',
                            'size changed<br>',
                            '<span ng-show="!isNaN(default)">(default size is {{sizes[default].size_no}})</span>',
                            '<span ng-show="isNaN(default)">(no default size)</span>',
                        '</span>',
                    '</div>',
                    '<div ng-show="sizes.length == 0"></div>',
                '</div>'

            ].join('')

        };

    });

}();
{'fraction_non_alphanumeric': 0.16998468606431852, 'fraction_numerical': 0.004211332312404288, 'mean_word_length': 1.2936786654960493, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 51, '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': '190587', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1345, 'n_words': 225}