<commit_before>const Promise = require('bluebird');
const get = require('lodash/get');
const { HttpStatusError } = require('common-errors');
const { billingAgreement, billingPlan, payment } = require('paypal-rest-sdk');

// helpers
const retryTimeout = parseInt(process.env.PAYPAL_RETRY_TIMEOUT || 6000, 10);
const retryCounter = parseInt(process.env.PAYPAL_RETRY_COUNT || 5, 10);
const retryDelay = parseInt(process.env.PAYPAL_RETRY_DELAY || 250, 10);
const invalidServerResponsePredicate = { httpStatusCode: 200, response: '' };
const promisify = (ops, context) => ops.reduce((acc, op) => {
  const opAsync = Promise.promisify(billingAgreement[op], { context });

  // init retry op
  acc[op] = function retryPaypalRequest(...args) {
    const tryOp = (counter = 0) => (
      opAsync(...args).catch(invalidServerResponsePredicate, (err) => {<commit_msg>fix: pick proper context<commit_after>const Promise = require('bluebird');
const get = require('lodash/get');
const { HttpStatusError } = require('common-errors');
const { billingAgreement, billingPlan, payment } = require('paypal-rest-sdk');

// helpers
const retryTimeout = parseInt(process.env.PAYPAL_RETRY_TIMEOUT || 6000, 10);
const retryCounter = parseInt(process.env.PAYPAL_RETRY_COUNT || 5, 10);
const retryDelay = parseInt(process.env.PAYPAL_RETRY_DELAY || 250, 10);
const invalidServerResponsePredicate = { httpStatusCode: 200, response: '' };
const promisify = (ops, context) => ops.reduce((acc, op) => {
  const opAsync = Promise.promisify(context[op], { context });

  // init retry op
  acc[op] = function retryPaypalRequest(...args) {
    const tryOp = (counter = 0) => (
      opAsync(...args).catch(invalidServerResponsePredicate, (err) => {
{'fraction_non_alphanumeric': 0.15227537922987164, 'fraction_numerical': 0.021003500583430573, 'mean_word_length': 5.399253731343284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2535272', 'n_tokens_mistral': 575, 'n_tokens_neox': 533, 'n_words': 117}