<commit_before>(function () {
    var _d2r = Math.PI/180.0;
    var _r2d = 180.0/Math.PI;

    function _randomRange (min, max) {
        return Math.random() * (max - min) + min;
    }

    Fire.merge ( Math, {
        TWO_PI: 2.0 * Math.PI,
        HALF_PI: 0.5 * Math.PI,

        // degree to radius
        deg2rad: function ( degree ) {
            return degree * _d2r;
        },

        // radius to degree
        rad2deg: function ( radius ) {
            return radius * _r2d;
        },

        // let radius in -pi to pi
        rad180: function ( radius ) {
            if ( radius > Math.PI || radius < -Math.PI ) {
                radius = (radius + Math.TOW_PI) % Math.TOW_PI;
            }
            return radius;
        },

        // let radius in 0 to 2pi
        rad360: function ( radius ) {
            if ( radius > Math.TWO_PI )
                return radius % Math.TOW_PI;
            else if ( radius < 0.0 )
                return Math.TOW_PI + radius % Math.TOW_PI;
            return radius;
        },

        // let degree in -180 to 180
        deg180: function ( degree ) {
            if ( degree > 180.0 || degree < -180.0 ) {
                degree = (degree + 360.0) % 360.0;
            }
            return degree;
        },

        // let degree in 0 to 360
        deg360: function ( degree ) {
            if ( degree > 360.0 )
                return degree % 360.0;
            else if ( degree < 0.0 )
                return 360.0 + degree % 360.0;
            return degree;
        },

        randomRange: _randomRange,

        randomRangeInt: function (min, max) {
            return Math.floor(_randomRange(min,max));
        },

        clamp: function ( val, min, max ) {
            return Math.min ( Math.max( val, min ), max );
        },
    } );

})();<commit_msg>add calculateMaxRect<commit_after>(function () {
    var _d2r = Math.PI/180.0;
    var _r2d = 180.0/Math.PI;

    function _randomRange (min, max) {
        return Math.random() * (max - min) + min;
    }

    Fire.merge ( Math, {
        TWO_PI: 2.0 * Math.PI,
        HALF_PI: 0.5 * Math.PI,

        // degree to radius
        deg2rad: function ( degree ) {
            return degree * _d2r;
        },

        // radius to degree
        rad2deg: function ( radius ) {
            return radius * _r2d;
        },

        // let radius in -pi to pi
        rad180: function ( radius ) {
            if ( radius > Math.PI || radius < -Math.PI ) {
                radius = (radius + Math.TOW_PI) % Math.TOW_PI;
            }
            return radius;
        },

        // let radius in 0 to 2pi
        rad360: function ( radius ) {
            if ( radius > Math.TWO_PI )
                return radius % Math.TOW_PI;
            else if ( radius < 0.0 )
                return Math.TOW_PI + radius % Math.TOW_PI;
            return radius;
        },

        // let degree in -180 to 180
        deg180: function ( degree ) {
            if ( degree > 180.0 || degree < -180.0 ) {
                degree = (degree + 360.0) % 360.0;
            }
            return degree;
        },

        // let degree in 0 to 360
        deg360: function ( degree ) {
            if ( degree > 360.0 )
                return degree % 360.0;
            else if ( degree < 0.0 )
                return 360.0 + degree % 360.0;
            return degree;
        },

        randomRange: _randomRange,

        randomRangeInt: function (min, max) {
            return Math.floor(_randomRange(min,max));
        },

        clamp: function ( val, min, max ) {
            return Math.min ( Math.max( val, min ), max );
        },

        /**
         * @param {Fire.Rect} out
         * @param {Fire.Vec2} p0
         * @param {Fire.Vec2} p1
         * @param {Fire.Vec2} p2
         * @param {Fire.Vec2} p3
         */
        calculateMaxRect: function (out, p0, p1, p2, p3) {
            var minX = Math.min(p0.x, p1.x, p2.x, p3.x);
            var maxX = Math.max(p0.x, p1.x, p2.x, p3.x);
            var minY = Math.min(p0.y, p1.y, p2.y, p3.y);
            var maxY = Math.max(p0.y, p1.y, p2.y, p3.y);
            out.x = minX;
            out.y = minY;
            out.width = maxX - minX;
            out.height = maxY - minY;
        },

    } );

})();
{'fraction_non_alphanumeric': 0.12354312354312354, 'fraction_numerical': 0.042890442890442894, 'mean_word_length': 1.2118556701030927, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6131584', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1347, 'n_words': 359}