<commit_before>'use strict';

const util = require('util');
const fs = require('fs');
const path = require('path');

var cfg;
var configFileName = path.join(__dirname, '../config.json');

function init() {
  _loadConfig();
}

function setCount(n) {
  n = parseInt(n, 10);
  if (util.isNumber(n)) {
    cfg.count = n;
    _saveConfig();
    return true;
  } else {
    return false;
  }
}

function getCount() {
  return cfg.count;
}

function _saveConfig() {
  fs.writeFile(configFileName, JSON.stringify(cfg, null, 4), function(err) {
    if(err) {
      console.log(err);
    } else {
      console.log("JSON saved to " + configFileName);
    }
  });
  _loadConfig();
}

function _loadConfig() {
  cfg = JSON.parse(fs.readFileSync(configFileName, 'utf8'));
}

module.exports = {
  init: init,
  setCount: setCount,
  getCount: getCount
};<commit_msg>isRunning<commit_after>'use strict';

const util = require('util');
const fs = require('fs');
const path = require('path');

var cfg;
var configFileName = path.join(__dirname, '../config.json');

function init() {
  _loadConfig();
}

function setCount(n) {
  n = parseInt(n, 10);
  if (util.isNumber(n)) {
    cfg.count = n;
    _saveConfig();
    return true;
  } else {
    return false;
  }
}

function getCount() {
  return cfg.count;
}

function _saveConfig() {
  fs.writeFileSync(configFileName, JSON.stringify(cfg, null, 2));
  _loadConfig();
}

function _loadConfig() {
  cfg = JSON.parse(fs.readFileSync(configFileName, 'utf8'));
}

module.exports = {
  init: init,
  setCount: setCount,
  getCount: getCount
};
{'fraction_non_alphanumeric': 0.16412213740458015, 'fraction_numerical': 0.005089058524173028, 'mean_word_length': 3.7811550151975686, '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': '5121682', 'n_tokens_mistral': 552, 'n_tokens_neox': 547, 'n_words': 124}