<commit_before>/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true,
strict:true, undef:true, unused:true, curly:true, devel:true, indent:2,
maxerr:50, newcap:true, browser:true */
/*exported whim*/
var whim = (function(){
  "use strict";
  function Config(configFile) {
    this._configFile = configFile;
    this._saved = true;
    this._saveTimeout = null;
    this._config = null;
  }
  Config.prototype.load = function(cb) {
    var _this = this;
    if (this._saved) {
      return whim.fs.read(this._configFile, "utf8", function(result) {
        if (result.data) {
          _this._config = JSON.parse(result.data);
        } else {
          _this._config = {};
        }
        cb && cb();
      });
    } else {
      cb && cb();
    }
  };
  Config.prototype.get = function(key) {
    if (this._config) {
      return this._config[key];
    }
  };
  Config.prototype.set = function(key, value) {
    if (this._config) {
      this._saved = false;
      this._config[key] = value;
      if (!this._saveTimeout) {
        this._saveTimeout = setTimeout(function() {
          this._saveTimeout = null;
          whim.fs.write(this._configFile, JSON.stringify(this._config, null, 2), "utf8", function(result) {
            if (result.success) {
              this._saved = true;
            }
          });
        }, 1000);
      }
    }<commit_msg>fixed: config will now actually save<commit_after>/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true,
strict:true, undef:true, unused:true, curly:true, devel:true, indent:2,
maxerr:50, newcap:true, browser:true */
/*exported whim*/
var whim = (function(){
  "use strict";
  function Config(configFile) {
    this._configFile = configFile;
    this._saved = true;
    this._saveTimeout = null;
    this._config = null;
  }
  Config.prototype.load = function(cb) {
    var _this = this;
    if (this._saved) {
      return whim.fs.read(this._configFile, "utf8", function(result) {
        if (result.data) {
          _this._config = JSON.parse(result.data);
        } else {
          _this._config = {};
        }
        cb && cb();
      });
    } else {
      cb && cb();
    }
  };
  Config.prototype.get = function(key) {
    if (this._config) {
      return this._config[key];
    }
  };
  Config.prototype.set = function(key, value) {
    var _this = this;
    if (this._config) {
      this._saved = false;
      this._config[key] = value;
      if (!this._saveTimeout) {
        this._saveTimeout = setTimeout(function() {
          _this._saveTimeout = null;
          whim.fs.write(_this._configFile, JSON.stringify(_this._config, null, 2), "utf8", function(result) {
            if (result.success) {
              _this._saved = true;
            }
          });
        }, 1000);
      }
    }
{'fraction_non_alphanumeric': 0.14845140619437522, 'fraction_numerical': 0.00711997152011392, 'mean_word_length': 2.2903981264637, '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': '1397897', 'n_tokens_mistral': 927, 'n_tokens_neox': 905, 'n_words': 180}