<commit_before>/**
 * BigCommerce OAuth2 Authentication and API access
 *
 * @param {Object} config
 * @return null
 *
 * Example Config  
 * {
 *   logLevel: 'info',
 *   clientId: 'hjasdfhj09sasd80dsf04dfhg90rsds',
 *   secret: '<KEY>',
 *   callback: 'https://mysite.com/bigcommerce'
 * }
 */

var logger = require('./logger'),
  request = require('superagent'),
  crypto = require('crypto');

var config;

function BigCommerce(cfg){

  if (!(this instanceof BigCommerce)) 
    return new BigCommerce(cfg);

  // The config is required to access the API
  if(!cfg){
    var error = 'Config missing. The config object is ' + 
      'required to make any call to the BigCommerce API';
    logger.error(error);
    throw new Error(error);
  }

  config = cfg;

  // Set the log level, default: 0
  var levels = { 'info': 1, 'error': 0 };
  logger.level = config.logLevel ? levels[config.logLevel] : 0;

}

BigCommerce.prototype.load = function(req, res, next){

  // Verify the signed request
  logger.info('Signed Payload:');
  logger.info(req.query['signed_payload']);

  var data = this.verify(req.query['signed_payload']);
  if(!data) 
    return next(new Error('The signed request provide was invalid.'));

  logger.info('Data sent by BigCommerce:');
  logger.info(data);

  req.bigCommerce = data;

  next();
};
<commit_msg>changed keyword to self<commit_after>/**
 * BigCommerce OAuth2 Authentication and API access
 *
 * @param {Object} config
 * @return null
 *
 * Example Config  
 * {
 *   logLevel: 'info',
 *   clientId: 'hjasdfhj09sasd80dsf04dfhg90rsds',
 *   secret: '<KEY>',
 *   callback: 'https://mysite.com/bigcommerce'
 * }
 */

var logger = require('./logger'),
  request = require('superagent'),
  crypto = require('crypto');

var config;

function BigCommerce(cfg){

  if (!(this instanceof BigCommerce)) 
    return new BigCommerce(cfg);

  // The config is required to access the API
  if(!cfg){
    var error = 'Config missing. The config object is ' + 
      'required to make any call to the BigCommerce API';
    logger.error(error);
    throw new Error(error);
  }

  config = cfg;

  // Set the log level, default: 0
  var levels = { 'info': 1, 'error': 0 };
  logger.level = config.logLevel ? levels[config.logLevel] : 0;

}

BigCommerce.prototype.load = function(req, res, next){

  // Verify the signed request
  logger.info('Signed Payload:');
  logger.info(req.query['signed_payload']);

  var data = self.verify(req.query['signed_payload']);
  if(!data) 
    return next(new Error('The signed request provide was invalid.'));

  logger.info('Data sent by BigCommerce:');
  logger.info(data);

  req.bigCommerce = data;

  next();
};

{'fraction_non_alphanumeric': 0.14606741573033707, 'fraction_numerical': 0.009737827715355805, 'mean_word_length': 3.5736301369863015, 'pattern_counts': {'":': 0, '<': 5, '<?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': '763211', 'n_tokens_mistral': 892, 'n_tokens_neox': 853, 'n_words': 241}