<commit_before>var crypto = require('crypto');
var ws = require('websocket');

exports.hmac = function(message, key) {
  return crypto.createHmac('sha1', key)
      .update(message)
      .digest('hex');
};

exports.atob = function(input) {
  return new Buffer(input, 'base64').toString('binary');
};

exports.WebSocket = ws.w3cwebsocket;<commit_msg>detect if the websocket peerdependency is not installed and handle it properly<commit_after>var crypto = require('crypto');

exports.hmac = function(message, key) {
  return crypto.createHmac('sha1', key)
      .update(message)
      .digest('hex');
};

exports.atob = function(input) {
  return new Buffer(input, 'base64').toString('binary');
};

try {
  //websocket is an optional module, so it is maybe not installed
  exports.WebSocket = require('websocket');
} catch (e) {}
{'fraction_non_alphanumeric': 0.15217391304347827, 'fraction_numerical': 0.008454106280193236, 'mean_word_length': 4.756944444444445, 'pattern_counts': {'":': 0, '<': 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': '1825536', 'n_tokens_mistral': 266, 'n_tokens_neox': 253, 'n_words': 65}