<commit_before>var path = require('path')
var mktemp = require('mktemp')


exports.Component = Component
function Component () {}

// Called before each build
Component.prototype.setup = function (options) {
  if (this._setupOptions != null) {
    throw new Error(this + ' already set up; did you insert it in more than one place?')
  }
  this._setupOptions = options
  this._setupChildComponents(this._childComponents || [])
}

// Called after each build
Component.prototype.teardown = function () {
  this._setupOptions = null
  this._teardownChildComponents(this._childComponents || [])
}

Component.prototype.addChildComponents = function (components) {
  this._childComponents = (this._childComponents || []).concat(components)
  if (this._setupOptions != null) this._setupChildComponents(components)
}

Component.prototype._setupChildComponents = function (components) {
  for (var i = 0; i < components.length; i++) {
    components[i].setup(this._setupOptions)
  }
}

Component.prototype._teardownChildComponents = function (components) {
  for (var i = 0; i < components.length; i++) {
    components[i].teardown()
  }
}
<commit_msg>Hint that we might allow reusing components in the future<commit_after>var path = require('path')
var mktemp = require('mktemp')


exports.Component = Component
function Component () {}

// Called before each build
Component.prototype.setup = function (options) {
  if (this._setupOptions != null) {
    throw new Error(this + ' already set up. Did you insert it in more than one place? That is not (yet?) supported.')
  }
  this._setupOptions = options
  this._setupChildComponents(this._childComponents || [])
}

// Called after each build
Component.prototype.teardown = function () {
  this._setupOptions = null
  this._teardownChildComponents(this._childComponents || [])
}

Component.prototype.addChildComponents = function (components) {
  this._childComponents = (this._childComponents || []).concat(components)
  if (this._setupOptions != null) this._setupChildComponents(components)
}

Component.prototype._setupChildComponents = function (components) {
  for (var i = 0; i < components.length; i++) {
    components[i].setup(this._setupOptions)
  }
}

Component.prototype._teardownChildComponents = function (components) {
  for (var i = 0; i < components.length; i++) {
    components[i].teardown()
  }
}

{'fraction_non_alphanumeric': 0.12468193384223919, 'fraction_numerical': 0.0016963528413910093, 'mean_word_length': 4.68433734939759, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2079861', 'n_tokens_mistral': 680, 'n_tokens_neox': 664, 'n_words': 172}