<commit_before>/** @preserve nodehelper
 *  @copyright 2014 <NAME> <<EMAIL>>
 *  @license MIT License <http://opensource.org/licenses/MIT>
 */

;(function() {
	function nh() {
		this.logging = true;
	}

	nh.prototype = {
		set: function ( key, val ) {
			if ( this.hasOwnProperty( key ) )
				this[ key ] = val;
			else
				this.nhLog( 'set: invalid property' );
		},

		nhLog: function ( msg ) {
			return this.logging ? console.log( 'nodehelper: ' + msg.toString() ) : false;
		},

		isString: function ( str ) {
			return typeof str === 'string' || str instanceof String;
		},

		// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
		isNumber: function ( num ) {
			return !isNaN( parseFloat( num ) ) && isFinite( num );
		},

		isObject: function ( obj ) {
			return obj === Object( obj ) && Object.prototype.toString.call( obj ) !== '[object Array]';
		},

		isFunction: function () {

		},

		each: function ( obj, callback ) {
			if ( !obj )
				return this.nhLog( 'each: obj is required' );

			if ( !callback )
				return this.nhLog( 'each: callback is required' );
			else if ( !this.isFunction( callback ) )
				return this.nhLog( 'each: callback must be a function' );
<commit_msg>added isFunction check<commit_after>/** @preserve nodehelper
 *  @copyright 2014 <NAME> <<EMAIL>>
 *  @license MIT License <http://opensource.org/licenses/MIT>
 */

;(function() {
	function nh() {
		this.logging = true;
	}

	nh.prototype = {
		set: function ( key, val ) {
			if ( this.hasOwnProperty( key ) )
				this[ key ] = val;
			else
				this.nhLog( 'set: invalid property' );
		},

		nhLog: function ( msg ) {
			return this.logging ? console.log( 'nodehelper: ' + msg.toString() ) : false;
		},

		isString: function ( str ) {
			return typeof str === 'string' || str instanceof String;
		},

		// http://stackoverflow.com/questions/18082/validate-numbers-in-javascript-isnumeric
		isNumber: function ( num ) {
			return !isNaN( parseFloat( num ) ) && isFinite( num );
		},

		isObject: function ( obj ) {
			return obj === Object( obj ) && Object.prototype.toString.call( obj ) !== '[object Array]';
		},

		isFunction: function ( obj ) {
			return Object.prototype.toString.call( obj ) === '[object Function]';
		},

		each: function ( obj, callback ) {
			if ( !obj )
				return this.nhLog( 'each: obj is required' );

			if ( !callback )
				return this.nhLog( 'each: callback is required' );
			else if ( !this.isFunction( callback ) )
				return this.nhLog( 'each: callback must be a function' );

{'fraction_non_alphanumeric': 0.161150512214342, 'fraction_numerical': 0.0070921985815602835, 'mean_word_length': 3.0885668276972624, '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': '451563', 'n_tokens_mistral': 948, 'n_tokens_neox': 812, 'n_words': 220}