<commit_before>// Add in reverse-diagonal algorithm
function reverseDiagonalAlgorithm (items) {
  // Sort the items by their diagonal
  items.sort(function (a, b) {
    var aDiag = Math.sqrt(Math.pow(a.height, 2) + Math.pow(a.width, 2)),
        bDiag = Math.sqrt(Math.pow(b.height, 2) + Math.pow(b.width, 2));
    return aDiag - bDiag;
  });

  // Iterate over each of the items
  var x = 0,
      y = 0;
  items.forEach(function (item) {
    var itemWidth = item.width;
    item.x = x - itemWidth;
    item.y = y;

    // Decrement the x and increment the y by the item's dimensions
    x -= itemWidth;
    y += item.height;
  });

  // Return the items
  return items;
}

// Export our algorithm
module.exports = reverseDiagonalAlgorithm;<commit_msg>Moving to multiple exports so we can skip elegantly<commit_after>// Add in reverse-diagonal algorithm
exports.sort = function (items) {
  // Sort the items by their diagonal
  items.sort(function (a, b) {
    var aDiag = Math.sqrt(Math.pow(a.height, 2) + Math.pow(a.width, 2)),
        bDiag = Math.sqrt(Math.pow(b.height, 2) + Math.pow(b.width, 2));
    return aDiag - bDiag;
  });
  return items;
};

exports.algorithm = function (items) {
  // Iterate over each of the items
  var x = 0,
      y = 0;
  items.forEach(function (item) {
    var itemWidth = item.width;
    item.x = x - itemWidth;
    item.y = y;

    // Decrement the x and increment the y by the item's dimensions
    x -= itemWidth;
    y += item.height;
  });

  // Return the items
  return items;
};
{'fraction_non_alphanumeric': 0.13114754098360656, 'fraction_numerical': 0.007868852459016393, 'mean_word_length': 2.6771084337349396, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2544448', 'n_tokens_mistral': 537, 'n_tokens_neox': 510, 'n_words': 161}