<commit_before>/**
 * Some additional functions I think would be nice to add to underscore.js.
 */

_.mixin({
	
    /**
     * @param {Any} num The thing we're testing for integer-ship.
     * @return {boolean} true if num is an integer (between Number.MIN_VALUE and
     * 	Number.MAX_VALUE) and false otherwise
     */
    isInteger: function(num) {
        return _.isFinite(num) && parseInt(num, undefined) == num;
    }
});<commit_msg>Got rid of isInteger due to its uselessness, added tryAgain and typeof functions to the mixin instead.<commit_after>/**
 * Some additional functions I think would be nice to add to underscore.js.
 */

_.mixin({
	/**
	 * Keep calling func until it returns a non-undefined, non-null value.
	 *
	 * @param {function} func - the function to call
	 * @param {object} context - the "this" object
	 * @param {...*} args - arguments to func
	 */
	tryAgain: function(func, context, args) {
		var res;
		while (res === undefined || res === null) {
			res = func.apply(context, Array.prototype.slice.call(arguments, 2));
		}
		return res;
	},

  /**
   * A better typeof operator-function thing.
   *
   * @param {object} mystery object
   * @return {string} the name of the object's constructor
   */
  typeof: function(obj) {
    return obj.constructor.toString().match(/function (\w+)\(.*/)[1];
  },
});
{'fraction_non_alphanumeric': 0.13707865168539327, 'fraction_numerical': 0.00149812734082397, 'mean_word_length': 3.060790273556231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1147974', 'n_tokens_mistral': 419, 'n_tokens_neox': 398, 'n_words': 142}