<commit_before>// Recursively render batches
// Receives {'A test': {value: fn, child: {subnode}}
function renderBatch(batch) {
  // Iterate over the values of the batch
  var contextNames = Object.getOwnPropertyNames(batch);
  contextNames.forEach(function recursivelyRender (contextName) {
    // Open the next context
    var context = batch[contextName],
        description = contextName,
        child = context.child,
        value = context.value;

    // If there is no child, we are on a leaf
    if (!child) {
      // Describe and execute `it`
      it(description, value);
    } else {
    // Otherwise, we are on a parent node
      // If there is a value, act on it
      if (value) {
        before(value);
      }

      // Keep on diving on the child
      describe(description, function execRecursiveRender () {
        return renderBatch.call(this, child);
      });
    }
  });
}

// Export renderBatch
module.exports = renderBatch;<commit_msg>Fixed up expansion errors -- after/beforeEach/afterEach are going to get complicated with this async junk o_o<commit_after>// Recursively render batches
// Receives {'A test': {value: fn, child: {subnode}}
function renderBatch(batch) {
  // Iterate over the values of the batch
  var contextNames = Object.getOwnPropertyNames(batch);
  contextNames.forEach(function recursivelyRender (contextName) {
    // Open the next context
    var context = batch[contextName],
        description = contextName,
        child = context.child,
        value = context.value,
        fns;

    // If there is no child, we are on a leaf
    if (!child) {
      // If the value is an array, run all of them in series
      if (Array.isArray(value)) {
        fns = value;
        it(description, function handleMultipleIts () {
          // TODO: Handle async fns
          var that = this;
          fns.forEach(function (fn) {
            fn.call(that);
          });
        });
      } else {
      // Otherwise, describe and execute `it`
        it(description, value);
      }
    } else {
    // Otherwise, we are on a parent node
      // If there is a value, act on it
      if (value) {
        // If it is an array, run all of them in series
        if (Array.isArray(value)) {
          fns = value;
          before(function handleMultipleBefore () {
            // TODO: Handle async fns
            var that = this;
            fns.forEach(function (fn) {
              fn.call(that);
            });
          });
        } else {
        // Otherwise, call it
          before(value);
        }
      }

      // Keep on diving on the child
      describe(description, function execRecursiveRender () {
        return renderBatch.call(this, child);
      });
    }
  });
}

// Export renderBatch
module.exports = renderBatch;
{'fraction_non_alphanumeric': 0.10383100608664518, 'fraction_numerical': 0.0, 'mean_word_length': 2.0568927789934355, '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': '1731956', 'n_tokens_mistral': 768, 'n_tokens_neox': 760, 'n_words': 260}