<commit_before>// TODO defaults for getters
// TODO parse multiline values (RFC 822)
// TODO interpolation in getters
// TODO events

var fs = require('fs'),
  EventEmitter = require('events').EventEmitter,
  utils = require('util');

var SECTION_DEFAULT = 'DEFAULT';

var ConfigParser = function(defaults) {
  EventEmitter.call(this);

  this._state = {};
  this._defaults = {};

  var defaultSection = this.optionxform(SECTION_DEFAULT);

  this.add_section(defaultSection);

  // copy default options and set them as initial state
  for (var currentKey in defaults) {
    if (defaults.hasOwnProperty(currentKey)) {
      var currentItem = defaults[currentKey];

      if (currentItem instanceof Object) {
        // hit a subsection
        this._defaults[currentKey] = defaults[currentKey];
        this._state[currentKey] = defaults[currentKey];
      } else {
        // an item in the hidden "DEFAULT" section
        if (!this._defaults[defaultSection]) {
          this._defaults[defaultSection] = {}
          this._state[defaultSection] = {}<commit_msg>Remove some todo notes<commit_after>var fs = require('fs'),
  EventEmitter = require('events').EventEmitter,
  utils = require('util');

var SECTION_DEFAULT = 'DEFAULT';

var ConfigParser = function(defaults) {
  EventEmitter.call(this);

  this._state = {};
  this._defaults = {};

  var defaultSection = this.optionxform(SECTION_DEFAULT);

  this.add_section(defaultSection);

  // copy default options and set them as initial state
  for (var currentKey in defaults) {
    if (defaults.hasOwnProperty(currentKey)) {
      var currentItem = defaults[currentKey];

      if (currentItem instanceof Object) {
        // hit a subsection
        this._defaults[currentKey] = defaults[currentKey];
        this._state[currentKey] = defaults[currentKey];
      } else {
        // an item in the hidden "DEFAULT" section
        if (!this._defaults[defaultSection]) {
          this._defaults[defaultSection] = {}
          this._state[defaultSection] = {}
{'fraction_non_alphanumeric': 0.11607142857142858, 'fraction_numerical': 0.001488095238095238, 'mean_word_length': 3.394335511982571, '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': '2864720', 'n_tokens_mistral': 556, 'n_tokens_neox': 547, 'n_words': 144}