<commit_before>var async = require('async');
var http = require('http');
var https = require('https');
var uuid = require('node-uuid');
var os = require('os');
var url = require('url');

var parser = require('./parser');
var packageJson = require('../package.json');

exports.VERSION = packageJson.version;

var SETTINGS = {
  accessToken: null,
  codeVersion: null,
  host: os.hostname(),
  environment: 'development',
  framework: 'node-js',
  root: null,  // root path to your code
  branch: null,  // git branch name
  handler: 'inline',  // 'nextTick' or 'setInterval' or 'inline'
  handlerInterval: 3,  // number of seconds to use with setInterval handler
  batchSize: 10,
  notifier: {
    name: 'node_rollbar',
    version: exports.VERSION
  },
  scrubHeaders: [],
  scrubFields: ['passwd', 'password', '<PASSWORD>', 'confirm_password', 'password_confirmation'],
  addRequestData: addRequestData
};

var apiClient;
var pendingItems = [];
var parsingItems = [];
var intervalHandler;

/*
 * Public API
 */

exports.init = function(api, options) {
  apiClient = api;
  options = options || {};
  SETTINGS.accessToken = api.accessToken;
  for (var opt in options) {
    SETTINGS[opt] = options[opt];
  }

  if (SETTINGS.handler == 'setInterval') {
    intervalHandler = setInterval(postItems, SETTINGS.handlerInterval * 1000);
  }
};

exports.shutdown = function(callback) {
  console.log('setting handler as inline');
  exports.changeHandler('inline');
  clearIntervalHandler();

  waitForParsingItems(function() {
    postItems(callback);
  });
};


exports.changeHandler = function(newHandler) {<commit_msg>Remove comment.<commit_after>var async = require('async');
var http = require('http');
var https = require('https');
var uuid = require('node-uuid');
var os = require('os');
var url = require('url');

var parser = require('./parser');
var packageJson = require('../package.json');

exports.VERSION = packageJson.version;

var SETTINGS = {
  accessToken: null,
  codeVersion: null,
  host: os.hostname(),
  environment: 'development',
  framework: 'node-js',
  root: null,  // root path to your code
  branch: null,  // git branch name
  handler: 'inline',  // 'nextTick' or 'setInterval' or 'inline'
  handlerInterval: 3,  // number of seconds to use with setInterval handler
  batchSize: 10,
  notifier: {
    name: 'node_rollbar',
    version: exports.VERSION
  },
  scrubHeaders: [],
  scrubFields: ['passwd', 'password', 'secret', '<PASSWORD>_password', 'password_<PASSWORD>'],
  addRequestData: addRequestData
};

var apiClient;
var pendingItems = [];
var parsingItems = [];
var intervalHandler;

/*
 * Public API
 */

exports.init = function(api, options) {
  apiClient = api;
  options = options || {};
  SETTINGS.accessToken = api.accessToken;
  for (var opt in options) {
    SETTINGS[opt] = options[opt];
  }

  if (SETTINGS.handler == 'setInterval') {
    intervalHandler = setInterval(postItems, SETTINGS.handlerInterval * 1000);
  }
};

exports.shutdown = function(callback) {
  exports.changeHandler('inline');
  clearIntervalHandler();

  waitForParsingItems(function() {
    postItems(callback);
  });
};


exports.changeHandler = function(newHandler) {
{'fraction_non_alphanumeric': 0.15174363807728558, 'fraction_numerical': 0.004398366321080742, 'mean_word_length': 4.378378378378378, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6224641', 'n_tokens_mistral': 994, 'n_tokens_neox': 980, 'n_words': 253}