<commit_before>(function() {

  function tweak(files, changes) {
    var newFiles = files.slice();
    if (changes.replace) {
      for (file in changes.replace) {
        var index = newFiles.indexOf(file);
        if (index == -1)
          throw file + ' not found when replacing ' + file + ' with ' + changes.replace[file];
        newFiles[index] = changes.replace[file];
      }
    }
    if (changes.remove) {
      changes.remove.forEach(function(file) {
        var index = newFiles.indexOf(file);
        if (index >= 0)
          newFiles.splice(index, 1);
      });
    }
    if (changes.add)
      newFiles = newFiles.concat(changes.add);
    return newFiles;<commit_msg>More consistent error reporting<commit_after>(function() {

  function tweak(files, changes) {
    var newFiles = files.slice();
    if (changes.replace) {
      for (file in changes.replace) {
        var index = newFiles.indexOf(file);
        if (index === -1)
          throw 'targetConfig: Cannot find file ' + file + ' to replace with ' + changes.replace[file] + ' in config.';
        newFiles[index] = changes.replace[file];
      }
    }
    if (changes.remove) {
      changes.remove.forEach(function(file) {
        var index = newFiles.indexOf(file);
        if (index === -1)
          throw 'targetConfig: Cannot find file ' + file + ' to remove from config.';
        newFiles.splice(index, 1);
      });
    }
    if (changes.add)
      newFiles = newFiles.concat(changes.add);
    return newFiles;
{'fraction_non_alphanumeric': 0.1348464619492657, 'fraction_numerical': 0.004005340453938585, 'mean_word_length': 2.3609865470852016, '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': '4071739', 'n_tokens_mistral': 451, 'n_tokens_neox': 440, 'n_words': 111}