<commit_before>// Generated by CoffeeScript 1.3.1
(function() {
  var checkFields, createColumnContent, createColumnTitles;

  exports.parse = function(params) {
    if (checkFields(params)) {
      return createColumnTitles(params, createColumnContent);
    }
  };

  checkFields = function(params) {
    var found, key, name, value, _i, _len, _ref, _ref1;
    _ref = params.fields;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      name = _ref[_i];
      found = false;
      _ref1 = params.data[0];
      for (key in _ref1) {
        value = _ref1[key];
        if (key === name) {
          found = true;
          break;
        }
      }
      if (found === false) {
        throw new Error("" + name + " is not a valid column specifier");
      }
    }
    return true;
  };

  createColumnTitles = function(params, callback) {
    var elem, str, _i, _len, _ref;
    str = '';
    _ref = params.fields;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      elem = _ref[_i];
      if (str !== '') {
        str += ',';
      }
      str += elem;
    }
    return callback(params, str);
  };

  createColumnContent = function(params, str) {
    var elem, field, line, _i, _j, _len, _len1, _ref, _ref1;
    _ref = params.data;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      elem = _ref[_i];
      line = '';
      _ref1 = params.fields;
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        field = _ref1[_j];
        if (line !== '') {
          line += ',';
        }
        line += JSON.stringify(elem[field]);
      }
      str += '\r\n' + line;
    }
    return str;
  };

}).call(this);
<commit_msg>compiled coffee to js<commit_after>// Generated by CoffeeScript 1.3.1
(function() {
  var checkFields, createColumnContent, createColumnTitles;

  exports.parse = function(params) {
    params.data = JSON.parse(JSON.stringify(params.data));
    if (checkFields(params)) {
      return createColumnTitles(params, createColumnContent);
    }
  };

  checkFields = function(params) {
    var found, key, name, value, _i, _len, _ref, _ref1;
    _ref = params.fields;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      name = _ref[_i];
      found = false;
      _ref1 = params.data[0];
      for (key in _ref1) {
        value = _ref1[key];
        if (key === name) {
          found = true;
          break;
        }
      }
      if (found === false) {
        throw new Error("" + name + " is not a valid column specifier");
      }
    }
    return true;
  };

  createColumnTitles = function(params, callback) {
    var elem, str, _i, _len, _ref;
    str = '';
    _ref = params.fields;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      elem = _ref[_i];
      if (str !== '') {
        str += ',';
      }
      str += elem;
    }
    return callback(params, str);
  };

  createColumnContent = function(params, str) {
    var elem, field, line, _i, _j, _len, _len1, _ref, _ref1;
    _ref = params.data;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
      elem = _ref[_i];
      line = '';
      _ref1 = params.fields;
      for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
        field = _ref1[_j];
        if (line !== '') {
          line += ',';
        }
        line += JSON.stringify(elem[field]);
      }
      str += '\r\n' + line;
    }
    return str;
  };

}).call(this);

{'fraction_non_alphanumeric': 0.15825214053734868, 'fraction_numerical': 0.011219368172423975, 'mean_word_length': 2.033124440465533, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1149376', 'n_tokens_mistral': 1215, 'n_tokens_neox': 1197, 'n_words': 305}