<commit_before>var EventEmitter = require('events').EventEmitter;

var startTime = 0;
var interval;

var info = {
  comName: 'MOCK',
  manufacturer: 'For testing purposes'
};

var sp = new EventEmitter();
sp.close = function(cb) {
  clearInterval(interval);
  interval = null;
  setTimeout(function() {
    sp.emit('close');
    cb();
  }, 0);
};
sp.write = function(msg, cb) {
  msg = msg.trim();
  switch (msg) {
    case 'stream.keys':
      sendMessage('stream.keys', 'sine noisy');
      break;
  }
  setTimeout(function() {
    cb();
  }, 0);
};
sp.path = info.comName;

function open() {
  startTime = Date.now();
  interval = setInterval(tick, 20);
  setTimeout(function() {
    sp.emit('open');
  }, 0);
  return sp;
}

function tick() {
  var t = (Date.now() - startTime) / 1000;
  var sine = 5 * Math.sin(t);
  var noisy = sine + Math.random();
  sendMessage('stream', [sine, noisy].join(' '));
}

function sendMessage(key, msg) {
  var data = '[' + getTimestamp() + '|' + key + '] ' + msg;
  sp.emit('data', data);
}

function getTimestamp() {
  var diff = Date.now() - startTime;
  var overpad = '00000000' + diff;
  return overpad.slice(-8);
}

module.exports = {
  info: info,
  open: open
};<commit_msg>More interesting mock port display<commit_after>var EventEmitter = require('events').EventEmitter;

var startTime = 0;
var interval;

var info = {
  comName: 'MOCK',
  manufacturer: 'For testing purposes'
};

var sp = new EventEmitter();
sp.close = function(cb) {
  clearInterval(interval);
  interval = null;
  setTimeout(function() {
    sp.emit('close');
    cb();
  }, 0);
};
sp.write = function(msg, cb) {
  msg = msg.trim();
  switch (msg) {
    case 'stream.keys':
      sendMessage('stream.keys', 'sine squiggly noisy');
      break;
  }
  setTimeout(function() {
    cb();
  }, 0);
};
sp.path = info.comName;

function open() {
  startTime = Date.now();
  interval = setInterval(tick, 20);
  setTimeout(function() {
    sp.emit('open');
  }, 0);
  return sp;
}

function tick() {
  var t = (Date.now() - startTime) / 1000;
  var sine = 5 * Math.sin(t);
  var squiggly = Math.sin(10 * t) + Math.sin(11 * t);
  var noisy = sine + 2 * (0.5 - Math.random());
  sendMessage('stream', [sine, squiggly, noisy].join(' '));
}

function sendMessage(key, msg) {
  var data = '[' + getTimestamp() + '|' + key + '] ' + msg;
  sp.emit('data', data);
}

function getTimestamp() {
  var diff = Date.now() - startTime;
  var overpad = '00000000' + diff;
  return overpad.slice(-8);
}

module.exports = {
  info: info,
  open: open
};
{'fraction_non_alphanumeric': 0.18671383647798742, 'fraction_numerical': 0.018474842767295597, 'mean_word_length': 3.3653516295025727, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '1412862', 'n_tokens_mistral': 950, 'n_tokens_neox': 914, 'n_words': 222}