<commit_before>const flatfile = require('flat-file-db')
const promise = require('promise')

let adapter

const repeatCharacter = (char, n) => `${Array(n + 1).join(char)}`

if (process.env.DB_ADAPTER) {
  const adapterName = `micro-analytics-adapter-${process.env.DB_ADAPTER}`
  try {
    adapter = require(adapterName)
    console.log(`Using ${adapterName}`)
  } catch (err) {
    if (err.code === 'MODULE_NOT_FOUND') {
      // Console.error a warning message, but normally exit the process to avoid printing ugly npm ERR lines and stack trace.
      console.error(`\n${repeatCharacter(' ', 22)}⚠️ ERROR ⚠️\n${repeatCharacter('-', 55)}\nYou specified "${process.env.DB_ADAPTER}" as the DB_ADAPTER, but no package\ncalled "${adapterName}" was found.\n\nPlease make sure you spelled the name correctly and\nhave "npm install"ed the necessary adapter package!\n${repeatCharacter('-', 55)}\n`)
      process.exit(0)
    }
  }
} else {
  console.log('Using standard flat-file-adapter')
  adapter = require('./flat-file-adapter')
}

module.exports = {
  get: adapter.get,
  getAll: adapter.getAll,
  put: adapter.put,
  has: adapter.has,
  keys: adapter.keys,<commit_msg>Remove unecessary import and logs from db.js<commit_after>const promise = require('promise')

let adapter

const repeatCharacter = (char, n) => `${Array(n + 1).join(char)}`

if (process.env.DB_ADAPTER) {
  const adapterName = `micro-analytics-adapter-${process.env.DB_ADAPTER}`
  try {
    adapter = require(adapterName)
  } catch (err) {
    if (err.code === 'MODULE_NOT_FOUND') {
      // Console.error a warning message, but normally exit the process to avoid printing ugly npm ERR lines and stack trace.
      console.error(`\n${repeatCharacter(' ', 22)}⚠️ ERROR ⚠️\n${repeatCharacter('-', 55)}\nYou specified "${process.env.DB_ADAPTER}" as the DB_ADAPTER, but no package\ncalled "${adapterName}" was found.\n\nPlease make sure you spelled the name correctly and\nhave "npm install"ed the necessary adapter package!\n${repeatCharacter('-', 55)}\n`)
      process.exit(0)
    }
  }
} else {
  adapter = require('./flat-file-adapter')
}

module.exports = {
  get: adapter.get,
  getAll: adapter.getAll,
  put: adapter.put,
  has: adapter.has,
  keys: adapter.keys,
{'fraction_non_alphanumeric': 0.1527777777777778, 'fraction_numerical': 0.007168458781362007, 'mean_word_length': 4.133333333333334, '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': '6999937', 'n_tokens_mistral': 726, 'n_tokens_neox': 721, 'n_words': 191}