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

  var helper = {};

  helper.randomString = function(len) {
    var s = [];
    for (var i = 0, n = Math.floor(len / 7); i < n; i++) {
      s.push(Math.random().toString(36).slice(-7));
    }
    var rem = len % 7;
    if (rem) {
      s.push(Math.random().toString(36).slice(-rem));
    }
    return s.join('');
  };

  helper.clamp = function(number, lower, upper) {
    return Math.min(Math.max(number, lower), upper);
  };

  helper.inherits = function(ctor, superCtor) {
    ctor.super_ = superCtor;
    ctor.prototype = Object.create(superCtor.prototype, {
      constructor: {
        value: ctor,
        enumerable: false,
        writable: true,
        configurable: true,
      },
    });
    return ctor;
  };

  helper.equal = function(a, b) {
    return (a != null && typeof a.equal === 'function') ? a.equal(b) : (a === b);
  };

  helper.values = function(obj) {
    return Object.keys(obj).map(function(key) {
      return obj[key];
    });
  };

  helper.clone = function(obj) {
    var ret = {};
    for (var key in obj) {
      ret[key] = obj[key];
    }
    return ret;
  };

  helper.extend = function(obj) {
    for (var i = 1, len = arguments.length; i < len; i++) {
      var src = arguments[i];
      for (var key in src) {
        obj[key] = src[key];
      }
    }
    return obj;
  };

  helper.pick = function(obj, keys) {
    var ret = {};
    if (!obj) {
      return ret;
    }
    keys.forEach(function(key) {
      if (key in obj) {
        ret[key] = obj[key];
      }
    });
    return ret;
  };

  helper.dig = function() {
    var args = Array.prototype.slice.call(arguments);
    return args.reduce(function(prev, curr) {
      return (typeof prev === 'object') ? prev[curr] : null;
    });
  };

  helper.sortBy = function(array, iteratee) {
    return array.slice().sort(function(a, b) {
      var l = (typeof iteratee === 'function') ? iteratee(a) : a[iteratee];
      var r = (typeof iteratee === 'function') ? iteratee(b) : b[iteratee];
      if (l > r) {
        return 1;
      } else if (l < r) {
        return -1;
      }
      return 0;
    });
  };

  helper.remove = function(array, item) {
    array.splice(array.indexOf(item), 1);
  };

  helper.moveToBack = function(array, item) {
    var index = array.indexOf(item);
    if (index === -1) {
      return;
    }
    array.splice(index, 1);<commit_msg>Add check if removing item is element of array<commit_after>(function(app) {
  'use strict';

  var helper = {};

  helper.randomString = function(len) {
    var s = [];
    for (var i = 0, n = Math.floor(len / 7); i < n; i++) {
      s.push(Math.random().toString(36).slice(-7));
    }
    var rem = len % 7;
    if (rem) {
      s.push(Math.random().toString(36).slice(-rem));
    }
    return s.join('');
  };

  helper.clamp = function(number, lower, upper) {
    return Math.min(Math.max(number, lower), upper);
  };

  helper.inherits = function(ctor, superCtor) {
    ctor.super_ = superCtor;
    ctor.prototype = Object.create(superCtor.prototype, {
      constructor: {
        value: ctor,
        enumerable: false,
        writable: true,
        configurable: true,
      },
    });
    return ctor;
  };

  helper.equal = function(a, b) {
    return (a != null && typeof a.equal === 'function') ? a.equal(b) : (a === b);
  };

  helper.values = function(obj) {
    return Object.keys(obj).map(function(key) {
      return obj[key];
    });
  };

  helper.clone = function(obj) {
    var ret = {};
    for (var key in obj) {
      ret[key] = obj[key];
    }
    return ret;
  };

  helper.extend = function(obj) {
    for (var i = 1, len = arguments.length; i < len; i++) {
      var src = arguments[i];
      for (var key in src) {
        obj[key] = src[key];
      }
    }
    return obj;
  };

  helper.pick = function(obj, keys) {
    var ret = {};
    if (!obj) {
      return ret;
    }
    keys.forEach(function(key) {
      if (key in obj) {
        ret[key] = obj[key];
      }
    });
    return ret;
  };

  helper.dig = function() {
    var args = Array.prototype.slice.call(arguments);
    return args.reduce(function(prev, curr) {
      return (typeof prev === 'object') ? prev[curr] : null;
    });
  };

  helper.sortBy = function(array, iteratee) {
    return array.slice().sort(function(a, b) {
      var l = (typeof iteratee === 'function') ? iteratee(a) : a[iteratee];
      var r = (typeof iteratee === 'function') ? iteratee(b) : b[iteratee];
      if (l > r) {
        return 1;
      } else if (l < r) {
        return -1;
      }
      return 0;
    });
  };

  helper.remove = function(array, item) {
    var index = array.indexOf(item);
    if (index === -1) {
      return;
    }
    array.splice(index, 1);
  };

  helper.moveToBack = function(array, item) {
    var index = array.indexOf(item);
    if (index === -1) {
      return;
    }
    array.splice(index, 1);
{'fraction_non_alphanumeric': 0.17296747967479675, 'fraction_numerical': 0.006300813008130081, 'mean_word_length': 2.1933809214795588, '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': '48257', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1692, 'n_words': 396}