<commit_before>'use strict'
const mkdirp = require('mkdirp')
const fs = require('fs')
const join = require('path').join
const root = process.cwd()
process.env.ROOT = root

const tmpPath = join(root, '.tmp')
mkdirp.sync(tmpPath)
const npmrc = [
  'store-path=./node_modules/.store',
  'fetch-retries=5',
  'fetch-retry-maxtimeout=180000'
]
fs.writeFileSync(join(tmpPath, '.npmrc'), npmrc, 'utf-8')

module.exports = function prepare (pkg) {
  const pkgTmpPath = join(tmpPath, Math.random().toString())
  mkdirp.sync(pkgTmpPath)
  const json = JSON.stringify(pkg || {})
  fs.writeFileSync(join(pkgTmpPath, 'package.json'), json, 'utf-8')
  process.chdir(pkgTmpPath)
}<commit_msg>refactor(tests): instead of random temp dir names, use date<commit_after>'use strict'
const mkdirp = require('mkdirp')
const fs = require('fs')
const join = require('path').join
const root = process.cwd()
process.env.ROOT = root

const tmpPath = join(root, '.tmp')
mkdirp.sync(tmpPath)
const npmrc = [
  'store-path=./node_modules/.store',
  'fetch-retries=5',
  'fetch-retry-maxtimeout=180000'
]
fs.writeFileSync(join(tmpPath, '.npmrc'), npmrc, 'utf-8')

module.exports = function prepare (pkg) {
  const pkgTmpPath = join(tmpPath, Number(new Date()).toString())
  mkdirp.sync(pkgTmpPath)
  const json = JSON.stringify(pkg || {})
  fs.writeFileSync(join(pkgTmpPath, 'package.json'), json, 'utf-8')
  process.chdir(pkgTmpPath)
}
{'fraction_non_alphanumeric': 0.17153024911032028, 'fraction_numerical': 0.012811387900355872, 'mean_word_length': 5.361990950226244, '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': '3676192', 'n_tokens_mistral': 527, 'n_tokens_neox': 509, 'n_words': 103}