<commit_before>(function( $ ) {
    $.widget("metro.progressbar", {

        version: "1.0.0",

        options: {
            value: 0,
            color: "bg-cyan",
            animate: false,
            onchange: function(val){}
        },

        _create: function(){
            var that = this,
                element = this.element;

            if (element.data('value') != undefined) {
                this.value(element.data('value')+'%');
            }

            if (element.data('color') != undefined) {
                this.options.color = element.data('color');
            }

            if (element.data('animate') != undefined) {
                this.options.animate = element.data('animate');
            }

            this._showBar();
        },

        _showBar: function(){
            var element = this.element;

            element.html('');

            var bar = $("<div />");
            bar.addClass("bar");
            if (this.options.color.indexOf("bg-")+1)
                bar.addClass(this.options.color);
            else {
                bar.css('background', this.options.color);
            }
            bar.appendTo(element);
            if (this.options.animate) {
                bar.animate({width: this.value()+'%'});
            } else {
                bar.css('width', this.value()+'%');
            }

            this.options.onchange(this.value());
        },

        value: function(val){
            if (val != undefined) {
                this.options.value = parseInt(val);
                this._showBar();
            } else {
                return parseInt(this.options.value);
            }
        },

        color: function(color){
            this.options.color = color;

            if (this.options.color.indexOf("bg-")+1)
                this.element.find(".bar").addClass(this.options.color);
            else {
                this.element.find(".bar").css('background', this.options.color);
            }
            this._showBar();
        },

        _destroy: function(){

        },

        _setOption: function(key, value){
            this._super('_setOption', key, value);
        }
    })
})( jQuery );

<commit_msg>Limit miniumum and maximum values<commit_after>(function( $ ) {
    $.widget("metro.progressbar", {

        version: "1.0.0",

        options: {
            value: 0,
            color: "bg-cyan",
            animate: false,
            onchange: function(val){}
        },

        _create: function(){
            var that = this,
                element = this.element;

            if (element.data('value') != undefined) {
                this.value(element.data('value')+'%');
            }

            if (element.data('color') != undefined) {
                this.options.color = element.data('color');
            }

            if (element.data('animate') != undefined) {
                this.options.animate = element.data('animate');
            }

            this._showBar();
        },

        _showBar: function(){
            var element = this.element;

            element.html('');

            var bar = $("<div />");
            bar.addClass("bar");
            if (this.options.color.indexOf("bg-")+1)
                bar.addClass(this.options.color);
            else {
                bar.css('background', this.options.color);
            }
            bar.appendTo(element);
            if (this.options.animate) {
                bar.animate({width: this.value()+'%'});
            } else {
                bar.css('width', this.value()+'%');
            }

            this.options.onchange(this.value());
        },

        value: function(val){
            if (val != undefined) {
				var parsedVal = parseInt(val);
				parsedVal = parsedVal > 100 ? 100 : parsedVal;
				parsedVal = parsedVal < 0 ? 0 : parsedVal;
                this.options.value = parsedVal;
                this._showBar();
            } else {
                return parseInt(this.options.value);
            }
        },

        color: function(color){
            this.options.color = color;

            if (this.options.color.indexOf("bg-")+1)
                this.element.find(".bar").addClass(this.options.color);
            else {
                this.element.find(".bar").css('background', this.options.color);
            }
            this._showBar();
        },

        _destroy: function(){

        },

        _setOption: function(key, value){
            this._super('_setOption', key, value);
        }
    })
})( jQuery );


{'fraction_non_alphanumeric': 0.15104281009879253, 'fraction_numerical': 0.0043907793633369925, 'mean_word_length': 1.340010272213662, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '3811316', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1190, 'n_words': 199}