<commit_before>define([], function () {
    function ChartBase() {
        return this;
    }

    ChartBase.prototype.defaultPieTooltipFormatter = function() {
        var fmt = this.series.options.format;
        var val = this.y;
        if (fmt) val = numeral(val).format(fmt);
        var a = this.point.name + '<br>' + this.series.name + ': <b>' + val + "</b><br>";
        a += parseFloat(this.point.percentage).toFixed(2).toString() + "%";
        return a;
    }

    ChartBase.prototype.defaultTooltipFormatter = function() {
        if (this.series) {
            var fmt = this.series.options.format;
            var val = this.y;
            if (fmt) val = numeral(val).format(fmt);
            var a = this.point.category + '<br/><span style="color:' + this.series.color + '">\u25CF</span>' + this.series.name + ':<b> ' + val + "</b>";
            return a;
        } else {
            var a = "";
            for (var i = 0; i < this.points.length; i++) {
                var fmt = this.points[i].series.options.format;
                var val = this.points[i].y;
                if (fmt) val = numeral(val).format(fmt);
                a += this.points[i].point.category + '<br/><span style="color:' + this.points[i].series.color + '">\u25CF</span>' + this.points[i].series.name + ':<b> ' + val + '<br>';
            }
            return a;
        }
    }

    ChartBase.prototype.defaultTimechartTooltipFormatter = function() {
        if (this.series) {
            var fmt = this.series.options.format;
            var val = this.y;
            if (fmt) val = numeral(val).format(fmt);
            var a = '<span style="color:' + this.series.color + '">\u25CF</span>' + this.series.name + ':<b> ' + val;
            return a;
        } else {
            var a = "";
            for (var i = this.points.length - 1; i > -1; i--) {
                var fmt = this.points[i].series.options.format;
                var val = this.points[i].y;
                if (fmt) val = numeral(val).format(fmt);
                a += '<span style="color:' + this.points[i].series.color + '">\u25CF</span>' + this.points[i].series.name + ':<b> ' + val + '<br>';
            }
            return a;
        }
    }

    ChartBase.prototype.fixData = function(tempData) {
        for (var g = 0; g < tempData.length; g++) {
            if (!tempData[g].y) tempData[g].y = null;
            if (tempData[g].y == "") tempData[g].y = null;
        }
    }

    ChartBase.getMinValue = function(data) {
        var min = Infinity;
        for (var i = 0; i < data.length; i++) {
            if (data[i] < min) min = data[i];
        }
        return min;
    };

    ChartBase.getMaxValue = function(data) {
        var max = Number.NEGATIVE_INFINITY;
        for (var i = 0; i < data.length; i++) {
            if (data[i] > max) max = data[i];
        }
        return max;
    }


    ChartBase.prototype.multivalueDataConvertor = function(config, d) {
        var cb = this;
        var data = d.data;

        config.yAxis.min = ChartBase.getMinValue(data.Data);

        config.series = [];
        config.xAxis.categories = [];
        for (var i = 0; i < data.Cols[1].tuples.length; i++) {
            config.xAxis.categories.push(data.Cols[1].tuples[i].caption.toString());
        };
        config.series = [];
        var tempData = [];

        if (data.Cols[0].tuples[0].children) {
            var k = 0;
            for(var t = 0; t < data.Cols[0].tuples.length; t++) {
                for (var c = 0; c < data.Cols[0].tuples[t].children.length; c++) {
                    tempData = [];
                    for (var d = 0; d < data.Cols[1].tuples.length; d++) {
                        tempData.push({
                            y: data.Data[data.Cols[0].tuples.length * data.Cols[0].tuples[t].children.length * d + t * data.Cols[0].tuples[t].children.length + c],
                            cube: data.Info.cubeName,
                            path: data.Cols[1].tuples[t].path
                        });
                        k++;
                    }
                    cb.fixData(tempData);
                    config.series.push({
                        data: tempData,
                        name: data.Cols[0].tuples[t].caption + "/" + data.Cols[0].tuples[t].children[c].caption,
                        format: data.Cols[0].tuples[t].children[c].format
                    });
                }
            }
        } else {
            for(var j = 0; j < data.Cols[0].tuples.length; j++) {
                tempData = [];
                for (var i = 0; i < data.Cols[1].tuples.length; i++) {
                    tempData.push({
                        y: data.Data[i * data.Cols[0].tuples.length + j],
                        drilldown: true,
                        cube: data.Info.cubeName,
                        path: data.Cols[1].tuples[i].path
                    });
                }
                cb.fixData(tempData);
                config.series.push({
                    data: tempData,
                    name: data.Cols[0].tuples[j].caption,
                    format: data.Cols[0].tuples[j].format
                });
            }
        }
    };

    function addDays(date, days) {
        var result = new Date(date);
        result.setDate(date.getDate() + days);
        return result;
    }
<commit_msg>fixes<commit_after>define([], function () {
    function ChartBase() {
        return this;
    }

    ChartBase.prototype.defaultPieTooltipFormatter = function() {
        var fmt = this.series.options.format;
        var val = this.y;
        if (fmt) val = numeral(val).format(fmt);
        var a = this.point.name + '<br>' + this.series.name + ': <b>' + val + "</b><br>";
        a += parseFloat(this.point.percentage).toFixed(2).toString() + "%";
        return a;
    }

    ChartBase.prototype.defaultTooltipFormatter = function() {
        if (this.series) {
            var fmt = this.series.options.format;
            var val = this.y;
            if (fmt) val = numeral(val).format(fmt);
            var a = this.point.category + '<br/><span style="color:' + this.series.color + '">\u25CF</span>' + this.series.name + ':<b> ' + val + "</b>";
            return a;
        } else {
            var a = "";
            for (var i = 0; i < this.points.length; i++) {
                var fmt = this.points[i].series.options.format;
                var val = this.points[i].y;
                if (fmt) val = numeral(val).format(fmt);
                a += this.points[i].point.category + '<br/><span style="color:' + this.points[i].series.color + '">\u25CF</span>' + this.points[i].series.name + ':<b> ' + val + '<br>';
            }
            return a;
        }
    }

    ChartBase.prototype.defaultTimechartTooltipFormatter = function() {
        if (this.series) {
            var fmt = this.series.options.format;
            var val = this.y;
            if (fmt) val = numeral(val).format(fmt);
            var a = '<span style="color:' + this.series.color + '">\u25CF</span>' + this.series.name + ':<b> ' + val;
            return a;
        } else {
            var a = "";
            for (var i = this.points.length - 1; i > -1; i--) {
                var fmt = this.points[i].series.options.format;
                var val = this.points[i].y;
                if (fmt) val = numeral(val).format(fmt);
                a += '<span style="color:' + this.points[i].series.color + '">\u25CF</span>' + this.points[i].series.name + ':<b> ' + val + '<br>';
            }
            return a;
        }
    }

    ChartBase.prototype.fixData = function(tempData) {
        for (var g = 0; g < tempData.length; g++) {
            if (!tempData[g].y) tempData[g].y = null;
            if (tempData[g].y == "") tempData[g].y = null;
        }
    }

    ChartBase.getMinValue = function(data) {
        var min = Infinity;
        for (var i = 0; i < data.length; i++) {
            if (data[i] < min) min = data[i];
        }
        return min;
    };

    ChartBase.getMaxValue = function(data) {
        var max = Number.NEGATIVE_INFINITY;
        for (var i = 0; i < data.length; i++) {
            if (data[i] > max) max = data[i];
        }
        return max;
    }


    ChartBase.prototype.multivalueDataConvertor = function(config, d) {
        var cb = this;
        var data = d.data;

        config.yAxis.min = ChartBase.getMinValue(data.Data);

        config.series = [];
        config.xAxis.categories = [];
        for (var i = 0; i < data.Cols[1].tuples.length; i++) {
            config.xAxis.categories.push(data.Cols[1].tuples[i].caption.toString());
        };
        config.series = [];
        var tempData = [];
        var hasChildren = false;
        if (data.Cols[0].tuples[0]) if (data.Cols[0].tuples[0].children) hasChildren = true;
        if (hasChildren) {
            var k = 0;
            for(var t = 0; t < data.Cols[0].tuples.length; t++) {
                for (var c = 0; c < data.Cols[0].tuples[t].children.length; c++) {
                    tempData = [];
                    for (var d = 0; d < data.Cols[1].tuples.length; d++) {
                        tempData.push({
                            y: data.Data[data.Cols[0].tuples.length * data.Cols[0].tuples[t].children.length * d + t * data.Cols[0].tuples[t].children.length + c],
                            cube: data.Info.cubeName,
                            drilldown: true,
                            path: data.Cols[1].tuples[t].path
                        });
                        k++;
                    }
                    cb.fixData(tempData);
                    config.series.push({
                        data: tempData,
                        name: data.Cols[0].tuples[t].caption + "/" + data.Cols[0].tuples[t].children[c].caption,
                        format: data.Cols[0].tuples[t].children[c].format
                    });
                }
            }
        } else {
            if (data.Cols[0].tuples.length == 0) data.Cols[0].tuples = [""]; // for no measures
            for(var j = 0; j < data.Cols[0].tuples.length; j++) {
                tempData = [];
                for (var i = 0; i < data.Cols[1].tuples.length; i++) {
                    tempData.push({
                        y: data.Data[i * data.Cols[0].tuples.length + j],
                        drilldown: true,
                        cube: data.Info.cubeName,
                        path: data.Cols[1].tuples[i].path
                    });
                }
                cb.fixData(tempData);
                var name = "Count";
                var format = "";
                if (data.Cols[0].tuples[j]) {
                    name = data.Cols[0].tuples[j].caption;
                    format = data.Cols[0].tuples[j].format;
                }

                config.series.push({
                    data: tempData,
                    name: name,
                    format: format
                });
            }
        }
    };

    function addDays(date, days) {
        var result = new Date(date);
        result.setDate(date.getDate() + days);
        return result;
    }

{'fraction_non_alphanumeric': 0.15795596921424737, 'fraction_numerical': 0.008054412027921962, 'mean_word_length': 1.3949849978568367, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 0, '>': 49, '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': '5276429', 'n_tokens_mistral': 3530, 'n_tokens_neox': 3386, 'n_words': 665}