<commit_before>const each = require('lodash/each');


function captureError(fn) {
  try {
    fn();
  }
  catch (e) {
    return e;
  }

  return null;
}


function restore(obj) {
  each(obj, v => {
    if (v && v.toString() === 'stub') v.restore();
  });
}


module.exports = {
  captureError,
  restore
};<commit_msg>Remove unused restore() test util<commit_after>const each = require('lodash/each');


function captureError(fn) {
  try {
    fn();
  }
  catch (e) {
    return e;
  }

  return null;
}


module.exports = {
  captureError
};
{'fraction_non_alphanumeric': 0.16758747697974216, 'fraction_numerical': 0.0, 'mean_word_length': 2.9420289855072466, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '1624424', 'n_tokens_mistral': 205, 'n_tokens_neox': 196, 'n_words': 44}