<commit_before>var assert = require('assert');
var msgpack = require('msgpack');

/**
 * Create a new response from a socket and info from the incoming request
 *
 * @constructor
 * @this Request
 * @param {Socket} socket Bound by the Server
 * @param {object} requestInfo Information about the incoming request
 * @api public
 */
function Response(socket, requestInfo) {
  this.socket = socket;
  this.address = requestInfo.address;
  this.port = requestInfo.port;
}

Response.prototype.send = function(command, data) {
  assert.deepEqual(typeof command, 'string', 'First argument must be a string');
  if (typeof data !== 'undefined') {
    assert.deepEqual(typeof data, 'object', 'Second argument must be an object');
  }

  this.socket.write(msgpack.pack([command, data]));
}

module.exports.Response = Response;<commit_msg>Fixed send method in response.<commit_after>var assert = require('assert');
var msgpack = require('msgpack');

/**
 * Create a new response from a socket and info from the incoming request
 *
 * @constructor
 * @this Request
 * @param {Socket} socket Bound by the Server
 * @param {object} requestInfo Information about the incoming request
 * @api public
 */
function Response(socket, requestInfo) {
  this.socket = socket;
  this.address = requestInfo.address;
  this.port = requestInfo.port;
}

Response.prototype.send = function(command, data) {
  assert.deepEqual(typeof command, 'string', 'First argument must be a string');
  if (typeof data !== 'undefined') {
    assert.deepEqual(typeof data, 'object', 'Second argument must be an object');
  }

  var packed = msgpack.pack([command, data]);
  this.socket.write(packed, 0, packed.length, this.socket, this.address);
}

module.exports.Response = Response;
{'fraction_non_alphanumeric': 0.12521539345203905, 'fraction_numerical': 0.0005743825387708214, 'mean_word_length': 4.6375404530744335, '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': '6765196', 'n_tokens_mistral': 489, 'n_tokens_neox': 482, 'n_words': 164}