<commit_before>/* eslint-disable */

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

const crypto = require('crypto')
const request = require('request')

function rest (key, secret, nonceGenerator) {
  this.url = 'https://api.bitfinex.com/'
  this.version = 'v1'
  this.key = key
  this.secret = secret
  this.nonce = new Date().getTime()
  this._nonce = typeof nonceGenerator === 'function' ? nonceGenerator : function () {
        // noinspection JSPotentiallyInvalidUsageOfThis
    return ++this.nonce
  }
}

rest.prototype.make_request = function (path, params, cb) {
  var headers, key, nonce, path, payload, signature, url, value
  if (!this.key || !this.secret) {
    return cb(new Error('missing api key or secret'))
  }
  url = `${this.url}/${this.version}/${path}`
  nonce = JSON.stringify(this._nonce())
  payload = {
    request: path,
    nonce
  }
  for (key in params) {
    value = params[key]
    payload[key] = value
  }
  payload = new Buffer(JSON.stringify(payload)).toString('base64')
  signature = crypto.createHmac('sha384', this.secret).update(payload).digest('hex')
  headers = {
    'X-BFX-APIKEY': this.key,
    'X-BFX-PAYLOAD': payload,
    'X-BFX-SIGNATURE': signature
  }
  return request({
    url,
    method: 'POST',
    headers,
    timeout: 15000
  }, (err, response, body) => {
    let error, result
    if (err || (response.statusCode !== 200 && response.statusCode !== 400)) {
      return cb(new Error(err != null ? err : response.statusCode))
    }
    try {
      result = JSON.parse(body)
    } catch (error1) {<commit_msg>fix ERROR: Must specify a 'request' field in the payload that matches the URL path<commit_after>/* eslint-disable */

process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'

const crypto = require('crypto')
const request = require('request')

function rest (key, secret, nonceGenerator) {
  this.url = 'https://api.bitfinex.com'
  this.version = 'v1'
  this.key = key
  this.secret = secret
  this.nonce = new Date().getTime()
  this._nonce = typeof nonceGenerator === 'function' ? nonceGenerator : function () {
        // noinspection JSPotentiallyInvalidUsageOfThis
    return ++this.nonce
  }
}

rest.prototype.make_request = function (path, params, cb) {
  var headers, key, nonce, path, payload, signature, url, value
  if (!this.key || !this.secret) {
    return cb(new Error('missing api key or secret'))
  }
  url = `${this.url}/${this.version}/${path}`
  nonce = JSON.stringify(this._nonce())
  payload = {
    request: `/${this.version}/${path}`,
    nonce
  }
  for (key in params) {
    value = params[key]
    payload[key] = value
  }
  payload = new Buffer(JSON.stringify(payload)).toString('base64')
  signature = crypto.createHmac('sha384', this.secret).update(payload).digest('hex')
  headers = {
    'X-BFX-APIKEY': this.key,
    'X-BFX-PAYLOAD': payload,
    'X-BFX-SIGNATURE': signature
  }
  return request({
    url,
    method: 'POST',
    headers,
    timeout: 15000
  }, (err, response, body) => {
    let error, result
    if (err || (response.statusCode !== 200 && response.statusCode !== 400)) {
      return cb(new Error(err != null ? err : response.statusCode))
    }
    try {
      result = JSON.parse(body)
    } catch (error1) {
{'fraction_non_alphanumeric': 0.15559006211180124, 'fraction_numerical': 0.011801242236024845, 'mean_word_length': 3.3704206241519676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '688192', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1074, 'n_words': 254}