<commit_before>(function() {
  'use strict';

  var yo = function() {};

  yo.prototype.isUndefined = function(val) {
    return val === void 0;
  };

  yo.prototype.isString = function(val) {
    return typeof val === 'string';
  };

  yo.prototype.isNumber = function(val) {
    return typeof val === 'number' && val.constructor === Number;
  };

  yo.prototype.isObject = function(val) {
    return typeof val === 'object';
  };

  yo.prototype.isFunction = function(val) {
    return typeof val === 'function';
  };

  yo.prototype.isArray = function(val) {
    return val && yo.isObject(val) && val.constructor === Array;
  };

  yo.prototype.isEqual = function(a, b) {
    return a === b;
  };

  yo.prototype.isFinite = function(n) {
    return yo.isNumber(n) && Number.isFinite(n);
  };

  yo.prototype.isPositive = function(n) {
    return yo.isFinite(n) && n > 0;
  };

  yo.prototype.isNegative = function(n) {
    return yo.isFinite(n) && n < 0;
  };

  yo.prototype.noop = function() {};

  yo.prototype.flatten = function(arr) {
    return yo.reduce(arr, function(a, b) {
      return a.concat(b);
    }, []);
  };

  yo.prototype.error = function(str) {
    throw new Error(str);
  };

  yo.prototype.every = function(arr) {
    return yo.reduce(arr, function(bool, item) {
      if(!item) {
        bool = false;
      }
      return bool;
    }, true);
  };

  yo.prototype.some = function(arr) {
    return yo.reduce(arr, function(bool, item) {
      if(item) {
        bool = true;
      }
      return bool;
    }, false);
  };

  yo.prototype.random = function(min, max) {
    if(yo.isUndefined(min)) {
      min = 0;
    }

    if(yo.isUndefined(max)) {
      max = 1;
    }

    if(!yo.isNumber(min) || !yo.isNumber(max)) {
      yo.error('No numbers provided');
    }

    return Math.floor(Math.random() * (max - min + 1) + min);
  };

  yo.prototype.$ = function(selector, context) {
    var element;

    if(typeof document === 'undefined') {
      yo.error('document object not found, are you in node?');
    }

    if(yo.isUndefined(selector)) {
      yo.error('No selector provided');
    }

    if(yo.isObject(selector) || yo.isArray(selector)) {
      element = selector;
    } else {

      var isClass = selector.match(/^\.[\w\d]/);
      var isId = selector.match(/^\#[\w\d]/);

      if(yo.isString(context)) {
        context = yo.$(context);
      }

      context = context || document;

      if(context.querySelectorAll) {
        if(isId) {
          element = context.querySelector(selector);
        } else {
          element = context.querySelectorAll(selector);
        }
      } else {
        if(isClass) {
          element = context.getElementsByClassName(selector.replace('.', ''));
        } else if(isId) {
          element = context.getElementById(selector.replace('#', ''));
        }
      }
    }

    return element;
  };

  yo.prototype.keys = function(obj) {
    var keys = [];
    for(var prop in obj) {
      keys.push(prop);
    }
    return keys;
  };

  yo.prototype.range = yo.prototype.times = function(n) {
    var arr = [];
    for(var i = 0; i < n; i++) {
      arr.push(i);
    }
    return arr;
  }

  yo.prototype.map = function(arr, callback) {
    if(!yo.isArray(arr)) {
      yo.error('No array given');
    }

    if(yo.isFunction(arr.map)) {
      return arr.map(callback);
    }

    var result = [];
    yo.each(arr, function(data) {
      result.push(callback(data));
    });

    return result;
  };

  yo.prototype.each = function(arr, callback) {
    if(yo.isFunction(arr.forEach)) {
      return arr.forEach(callback);
    }

    for(var i = 0; i < arr.length; ++i) {
      callback(arr[i]);
    }
  };

  yo.prototype.extend = function(obj, val) {
    var newObj = {};

    for(var prop in obj) {
      newObj[prop] = obj[prop];
    }

    for(var prop in val) {
      newObj[prop] = val[prop];<commit_msg>Fix isEqual, map and each<commit_after>(function() {
  'use strict';

  var yo = function() {};

  yo.prototype.isUndefined = function(val) {
    return val === void 0;
  };

  yo.prototype.isString = function(val) {
    return typeof val === 'string';
  };

  yo.prototype.isNumber = function(val) {
    return typeof val === 'number' && val.constructor === Number;
  };

  yo.prototype.isObject = function(val) {
    return typeof val === 'object';
  };

  yo.prototype.isFunction = function(val) {
    return typeof val === 'function';
  };

  yo.prototype.isArray = function(val) {
    return val && yo.isObject(val) && val.constructor === Array;
  };

  yo.prototype.isEqual = function(a, b) {
    if(a === b) {
      return true;
    }

    if(yo.isArray(a) && yo.isArray(b)) {
      if(a.length !== b.length) {
        return false;
      }

      return yo.every(yo.map(a, function(value, i) {
        return value === b[i];
      }));
    }

    return false;
  };

  yo.prototype.isEmpty = function(val) {
    return val.length === 0;
  };

  yo.prototype.isFinite = function(n) {
    return yo.isNumber(n) && Number.isFinite(n);
  };

  yo.prototype.isPositive = function(n) {
    return yo.isFinite(n) && n > 0;
  };

  yo.prototype.isNegative = function(n) {
    return yo.isFinite(n) && n < 0;
  };

  yo.prototype.noop = function() {};

  yo.prototype.flatten = function(arr) {
    return yo.reduce(arr, function(a, b) {
      return a.concat(b);
    }, []);
  };

  yo.prototype.error = function(str) {
    throw new Error(str);
  };

  yo.prototype.every = function(arr) {
    return yo.reduce(arr, function(bool, item) {
      if(!item) {
        bool = false;
      }
      return bool;
    }, true);
  };

  yo.prototype.some = function(arr) {
    return yo.reduce(arr, function(bool, item) {
      if(item) {
        bool = true;
      }
      return bool;
    }, false);
  };

  yo.prototype.random = function(min, max) {
    if(yo.isUndefined(min)) {
      min = 0;
    }

    if(yo.isUndefined(max)) {
      max = 1;
    }

    if(!yo.isNumber(min) || !yo.isNumber(max)) {
      yo.error('No numbers provided');
    }

    return Math.floor(Math.random() * (max - min + 1) + min);
  };

  yo.prototype.$ = function(selector, context) {
    var element;

    if(typeof document === 'undefined') {
      yo.error('document object not found, are you in node?');
    }

    if(yo.isUndefined(selector)) {
      yo.error('No selector provided');
    }

    if(yo.isObject(selector) || yo.isArray(selector)) {
      element = selector;
    } else {

      var isClass = selector.match(/^\.[\w\d]/);
      var isId = selector.match(/^\#[\w\d]/);

      if(yo.isString(context)) {
        context = yo.$(context);
      }

      context = context || document;

      if(context.querySelectorAll) {
        if(isId) {
          element = context.querySelector(selector);
        } else {
          element = context.querySelectorAll(selector);
        }
      } else {
        if(isClass) {
          element = context.getElementsByClassName(selector.replace('.', ''));
        } else if(isId) {
          element = context.getElementById(selector.replace('#', ''));
        }
      }
    }

    return element;
  };

  yo.prototype.keys = function(obj) {
    var keys = [];
    for(var prop in obj) {
      keys.push(prop);
    }
    return keys;
  };

  yo.prototype.range = yo.prototype.times = function(n) {
    var arr = [];
    for(var i = 0; i < n; i++) {
      arr.push(i);
    }
    return arr;
  }

  yo.prototype.map = function(arr, callback) {
    if(!yo.isArray(arr)) {
      yo.error('No array given');
    }

    if(yo.isFunction(arr.map)) {
      return arr.map(callback);
    }

    var result = [];
    yo.each(arr, function(data) {
      result.push(callback(data, i, arr));
    });

    return result;
  };

  yo.prototype.each = function(arr, callback) {
    if(yo.isFunction(arr.forEach)) {
      return arr.forEach(callback);
    }

    for(var i = 0; i < arr.length; ++i) {
      callback(arr[i], i, arr);
    }
  };

  yo.prototype.extend = function(obj, val) {
    var newObj = {};

    for(var prop in obj) {
      newObj[prop] = obj[prop];
    }

    for(var prop in val) {
      newObj[prop] = val[prop];
{'fraction_non_alphanumeric': 0.17022844509948415, 'fraction_numerical': 0.002087939081306804, 'mean_word_length': 2.265036086607859, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, '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': '989992', 'n_tokens_mistral': 2820, 'n_tokens_neox': 2727, 'n_words': 534}