<commit_before>"use strict"

var Promise = require("bluebird")
var semver = require("semver")
var request = require("request")
var extend = require("extend")
var mkdirp = require("mkdirp")
var path = require("path")
var fs = require("fs")
var split = require("split")
var crypto = require("crypto")
var tar = require("tar")

var Installation = require("./Installation.js")

var Installer = module.exports = function (targetPath, versionSelector, opts) {
  this._targetPath = targetPath

  if (semver.validRange(versionSelector) === null) {
    throw new Error("Error validationg version selector: " + versionSelector)
  }

  this._opts = opts = extend({
    platform: process.platform,
    arch: process.arch
  }, opts)<commit_msg>Use custom User-Agent header when making requests<commit_after>"use strict"

var Promise = require("bluebird")
var semver = require("semver")
var extend = require("extend")
var mkdirp = require("mkdirp")
var path = require("path")
var fs = require("fs")
var split = require("split")
var crypto = require("crypto")
var tar = require("tar")

var request = (function (request) {
  return function (url, cb) {
    return request({
      url: url,
      headers: { "User-Agent": "request iojs-bundler (" + moduleVersion + ")" }
    }, cb)
  }
})(require("request"))

var Installation = require("./Installation.js")

var moduleVersion = require(path.resolve(__dirname, "..", "package.json")).version

var Installer = module.exports = function (targetPath, versionSelector, opts) {
  this._targetPath = targetPath

  if (semver.validRange(versionSelector) === null) {
    throw new Error("Error validationg version selector: " + versionSelector)
  }

  this._opts = opts = extend({
    platform: process.platform,
    arch: process.arch
  }, opts)
{'fraction_non_alphanumeric': 0.14511575381140598, 'fraction_numerical': 0.0, 'mean_word_length': 4.661341853035144, 'pattern_counts': {'":': 1, '<': 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': '2591603', 'n_tokens_mistral': 521, 'n_tokens_neox': 511, 'n_words': 149}