<commit_before>const fs = require('fs')
const path = require('path')
const cp = require('child_process')

const karmaPath = path.join(__dirname, 'node_modules', 'karma')

try {
  const { version } = JSON.parse(
    fs.readFileSync(
      path.join(karmaPath, 'node_modules', 'socket.io', 'package.json')
    )
  )
  if (parseInt(version, 10) < 2) {
    console.log(`you are using karma version under 2.x, upgrading now...`)
    cp.execSync('npm install socket.io@2.0.3', {
      cwd: karmaPath
    })
  }
} catch (e) {}<commit_msg>build: discard npm version upgrade karma anyway<commit_after>const fs = require('fs')
const path = require('path')
const cp = require('child_process')

const karmaPath = path.join(__dirname, 'node_modules', 'karma')

function upgradeKarma () {
  console.log(`you are using socket.io version under 2.x, upgrading now...`)
  cp.execSync('npm install socket.io@2.0.3', {
    cwd: karmaPath
  })
}

try {
  const { version } = JSON.parse(
    fs.readFileSync(
      path.join(karmaPath, 'node_modules', 'socket.io', 'package.json')
    )
  )
  if (parseInt(version, 10) < 2) {
    upgradeKarma()
  }
} catch (e) {
  upgradeKarma()
}
{'fraction_non_alphanumeric': 0.16048317515099222, 'fraction_numerical': 0.012079378774805867, 'mean_word_length': 3.6963562753036436, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6907017', 'n_tokens_mistral': 423, 'n_tokens_neox': 405, 'n_words': 96}