<commit_before>/**
 * Flot plugin for adding additional auto scalling modes.
 *
 * @author <NAME>
 */
(function($){
    function init(plot){
        
        plot.autoScale = function(){
            var opts = plot.getYAxes()[0].options;
            var data = plot.getData();
            var max = 0;

            $.each(data, function(index, s) {
                max = Math.max(max, autoScale(plot, s, s.data, s.datapoints));
            });
            
            opts.min = 0;
            opts.max = max;
            
            plot.setupGrid();
            plot.draw();
            
            return {
                min: opts.min,
                max: opts.max
            };
        }
        
        function autoScale(plot, series, data, datapoints){
            _max = Number.NEGATIVE_INFINITY;
            var options = plot.getOptions();
            
            // limit to visible serie
            if (series.lines.show || series.points.show) {
                var max = Number.NEGATIVE_INFINITY;
                
                for (var i = 0; i < data.length; i++) {
                    max = Math.max(max, data[i][1]);
                }
                
                max += max * options.yaxis.autoscaleMargin * 10;
                return Math.max(_max, max);
            }
        }
    }
    
    $.plot.plugins.push({
        init: init,
        options: options,
        name: "autoscalemode",
        version: "0.5"
    });
})(jQuery);<commit_msg>Removed options parameter from autoscale.<commit_after>/**
 * Flot plugin for adding additional auto scalling modes.
 *
 * @author <NAME>
 */
(function($){
    function init(plot){
        
        plot.autoScale = function(){
            var opts = plot.getYAxes()[0].options;
            var data = plot.getData();
            var max = 0;

            $.each(data, function(index, s) {
                max = Math.max(max, autoScale(plot, s, s.data, s.datapoints));
            });
            
            opts.min = 0;
            opts.max = max;
            
            plot.setupGrid();
            plot.draw();
            
            return {
                min: opts.min,
                max: opts.max
            };
        }
        
        function autoScale(plot, series, data, datapoints){
            _max = Number.NEGATIVE_INFINITY;
            var options = plot.getOptions();
            
            // limit to visible serie
            if (series.lines.show || series.points.show) {
                var max = Number.NEGATIVE_INFINITY;
                
                for (var i = 0; i < data.length; i++) {
                    max = Math.max(max, data[i][1]);
                }
                
                max += max * options.yaxis.autoscaleMargin * 10;
                return Math.max(_max, max);
            }
        }
    }
    
    $.plot.plugins.push({
        init: init,
        name: "autoscalemode",
        version: "0.5"
    });
})(jQuery);
{'fraction_non_alphanumeric': 0.12103843560350641, 'fraction_numerical': 0.006068779501011463, 'mean_word_length': 1.14378612716763, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4605814', 'n_tokens_mistral': 854, 'n_tokens_neox': 819, 'n_words': 185}