<commit_before>/*!
 * na-hermite-interpolation v0.4.0
 * https://github.com/tfoxy/na-hermite-interpolation
 *
 * Copyright 2015 <NAME>
 * Released under the MIT license
 */
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():t.HermiteInterpolation=e()}(this,function(){"use strict";function t(t,e,i){this.name="DuplicateError",this.message="Duplicate value at x"+e+" and x"+i+". Value: "+t,this.duplicateValue=t,this.firstIndex=e,this.secondIndex=i}function e(){this.data=[],this._column=[],this._prevColumn=[],this._data=[],this._currentFactorialResult=1,this._currentFactorialFactor=1}function i(i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,e.prototype.calculateDividedDifferences=function(){if(0!==this.data.length){this._prepareData();var t=this._calculateDividedDifferences();return this._cleanUp(),t}},e.prototype.calculatePolynomialCoefficients=function(){if(0===this.data.length)return[];this._prepareData();var t=this._calculateDividedDifferences();return this.emit("preCoefficients",t),this._calculatePolynomialCoefficients(t)},e.prototype._calculatePolynomialCoefficients=function(t){for(var e,i,r=t.slice(),a=[],o=function(t){return t.times(e)},n=function(t,e){a[e+1]=a[e+1].plus(t)},c=function(t,e){r[e]=i.times(t).plus(r[e])},s=1;s<r.length;s++){e=this._data[s-1].x.neg(),i=t[s];var u=a;a=u.map(o),a.push(e),u.forEach(n),a.forEach(c)}return this.emit("coefficients",r),this._cleanUp(),r},e.prototype._prepareData=function(){this._checkDuplicateX(),this._cloneData(),this._multiplyPointsWithDifferential(),this._orderDataByX(),this._initPrevColumn(),this.emit("dataInitialized",this._data)},e.prototype._checkDuplicateX=function(){var e=Object.create(null);this.data.forEach(function(i,r){var a=JSON.stringify(i.x);a in e&&this.emit("error",new t(i.x,e[a],r)),e[a]=r},this)},e.prototype._cloneData=function(){this._data=this.data.map(function(t){var e={x:t.x,y:t.y};return e.d=t.d?Array.isArray(t.d)?t.d:[t.d]:[],e})},e.prototype._multiplyPointsWithDifferential=function(){for(var t=this._data.length,e=0;t>e;++e)for(var i=this._data[e],r=0;r<i.d.length;++r)this._data.push(i)},e.prototype._orderDataByX=function(){this._data.sort(e._dataCompareFn)},e.prototype._initPrevColumn=function(){this._data.forEach(function(t){this._prevColumn.push(t.y)},this)},e.prototype._calculateDividedDifferences=function(){for(var t=[this._data[0].y],e=1;e<this._data.length;e++){t.push(this._calculateStepResult(0,e));for(var i=1;i<this._data.length-e;i++)this._calculateStepResult(i,i+e);this._prevColumn=this._column,this._column=[]}return this._prevColumn=[],t},e.prototype._calculateStepResult=function(t,e){var i,r=this._data[t].x,a=this._data[e].x;if(0===r.cmp(a))i=this._getDifferentialResult(this._data[t],e-t);else{var o=a.minus(r),n=this._prevColumn[t+1].minus(this._prevColumn[t]);i=n.div(o)}return this._column.push(i),this.emit("step",{i:t,j:e,result:i}),i},e.prototype._getDifferentialResult=function(t,e){return 1===e?t.d[0]:t.d[e-1].div(this._factorial(e))},e.prototype._factorial=function(t){return t!==this._currentFactorialFactor&&(this._currentFactorialResult*=++this._currentFactorialFactor),this._currentFactorialResult},e.prototype._cleanUp=function(){this._data=[],this._currentFactorialResult=1,this._currentFactorialFactor=1}}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e._dataCompareFn=function(t,e){return t.x.cmp(e.x)},e.DuplicateError=t,e.setEventEmitter=i;var r;return r="object"==typeof module&&module.exports?require("events").EventEmitter:{prototype:{on:function(){}}},e.setEventEmitter(r),e});<commit_msg>Minify<commit_after>/*!
 * na-hermite-interpolation v0.4.1
 * https://github.com/tfoxy/na-hermite-interpolation
 *
 * Copyright 2015 <NAME>
 * Released under the MIT license
 */
!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof module&&module.exports?module.exports=e():t.HermiteInterpolation=e()}(this,function(){"use strict";function t(t,e,i){this.name="DuplicateError",this.message="Duplicate value at x"+e+" and x"+i+". Value: "+t,this.duplicateValue=t,this.firstIndex=e,this.secondIndex=i}function e(){this.data=[],this._column=[],this._prevColumn=[],this._data=[],this._currentFactorialResult=1,this._currentFactorialFactor=1}function i(i){e.prototype=Object.create(i.prototype),e.prototype.constructor=e,e.prototype.calculateDividedDifferences=function(){if(0!==this.data.length){this._prepareData();var t=this._calculateDividedDifferences();return this._cleanUp(),t}},e.prototype.calculatePolynomialCoefficients=function(){if(0===this.data.length)return[];this._prepareData();var t=this._calculateDividedDifferences();return this.emit("preCoefficients",t),this._calculatePolynomialCoefficients(t)},e.prototype._calculatePolynomialCoefficients=function(t){for(var e,i,r=t.slice(),a=[],n=function(t){return t.times(e)},o=function(t,e){a[e+1]=a[e+1].plus(t)},s=function(t,e){r[e]=i.times(t).plus(r[e])},c=1;c<r.length;c++){e=this._data[c-1].x.neg(),i=t[c];var u=a;a=u.map(n),a.push(e),u.forEach(o),a.forEach(s)}return this.emit("coefficients",r),this._cleanUp(),r},e.prototype._prepareData=function(){this._checkDuplicateX(),this._cloneData(),this._multiplyPointsWithDifferential(),this._orderDataByX(),this._initPrevColumn(),this.emit("dataInitialized",this._data)},e.prototype._checkDuplicateX=function(){var e=Object.create(null);this.data.forEach(function(i,r){var a=JSON.stringify(i.x);a in e&&this.emit("error",new t(i.x,e[a],r)),e[a]=r},this)},e.prototype._cloneData=function(){this._data=this.data.map(function(t){var e={x:t.x,y:t.y};return t.d?Array.isArray(t.d)?e.d=t.d:e.d=[t.d]:e.d=[],e})},e.prototype._multiplyPointsWithDifferential=function(){for(var t=this._data.length,e=0;t>e;++e)for(var i=this._data[e],r=0;r<i.d.length;++r)this._data.push(i)},e.prototype._orderDataByX=function(){this._data.sort(e._dataCompareFn)},e.prototype._initPrevColumn=function(){this._data.forEach(function(t){this._prevColumn.push(t.y)},this)},e.prototype._calculateDividedDifferences=function(){for(var t=[this._data[0].y],e=1;e<this._data.length;e++){t.push(this._calculateStepResult(0,e));for(var i=1;i<this._data.length-e;i++)this._calculateStepResult(i,i+e);this._prevColumn=this._column,this._column=[]}return this._prevColumn=[],t},e.prototype._calculateStepResult=function(t,e){var i,r=this._data[t].x,a=this._data[e].x;if(0===r.cmp(a))i=this._getDifferentialResult(this._data[t],e-t);else{var n=a.minus(r),o=this._prevColumn[t+1].minus(this._prevColumn[t]);i=o.div(n)}return this._column.push(i),this.emit("step",{i:t,j:e,result:i}),i},e.prototype._getDifferentialResult=function(t,e){return 1===e?t.d[0]:t.d[e-1].div(this._factorial(e))},e.prototype._factorial=function(t){return t!==this._currentFactorialFactor&&(this._currentFactorialResult*=++this._currentFactorialFactor),this._currentFactorialResult},e.prototype._cleanUp=function(){this._data=[],this._currentFactorialResult=1,this._currentFactorialFactor=1}}t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,e._dataCompareFn=function(t,e){return t.x.cmp(e.x)},e.DuplicateError=t,e.setEventEmitter=i;var r={prototype:{on:function(){throw new Error("An EventEmitter library needs to be set using HermiteInterpolation.setEventEmitter(EventEmitter) method. The /on/ function cannot be used otherwise")},emit:function(){}}};if("object"==typeof module&&module.exports)try{r=require("events").EventEmitter}catch(a){}return e.setEventEmitter(r),e});
{'fraction_non_alphanumeric': 0.22074468085106383, 'fraction_numerical': 0.007446808510638298, 'mean_word_length': 13.27134724857685, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '4099300', 'n_tokens_mistral': 2768, 'n_tokens_neox': 2748, 'n_words': 128}