<commit_before>const level = require('level');
const path = require('path');
const h = require('virtual-dom/h');
const createElement = require('virtual-dom/create-element');
const inline = require('html-inline');
const fromString = require('from2-string');
const process = require('process');
const moment = require('moment');
const wordcount = require('wordcount');
const roundTo = require('round-to');

const topUsers = require('./lib/top-users');

const db = level(path.resolve('./db'), {valueEncoding: 'json'});

const users = {};

db.createValueStream()
  .on('data', data => {
    if (!users[data.user]) {
      users[data.user] = {
        lines: 0,
        avgWords: 0,
        quotes: [],
        latest: moment.utc(data.timestamp),
        questions: 0
      };
    }

    users[data.user].lines++;<commit_msg>generate: `path.resolve` from `__dirname`<commit_after>const level = require('level');
const path = require('path');
const h = require('virtual-dom/h');
const createElement = require('virtual-dom/create-element');
const inline = require('html-inline');
const fromString = require('from2-string');
const process = require('process');
const moment = require('moment');
const wordcount = require('wordcount');
const roundTo = require('round-to');

const topUsers = require('./lib/top-users');

const db = level(path.resolve(__dirname, 'db'), {valueEncoding: 'json'});

const users = {};

db.createValueStream()
  .on('data', data => {
    if (!users[data.user]) {
      users[data.user] = {
        lines: 0,
        avgWords: 0,
        quotes: [],
        latest: moment.utc(data.timestamp),
        questions: 0
      };
    }

    users[data.user].lines++;
{'fraction_non_alphanumeric': 0.18187239117471676, 'fraction_numerical': 0.004770423375074538, 'mean_word_length': 3.8497109826589595, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1485647', 'n_tokens_mistral': 509, 'n_tokens_neox': 498, 'n_words': 115}