<commit_before>var Stream = require('stream'),
    util = require('util'),
    devices = require('./devices.js'),
    circularBuffer = require('./circular_buffer.js'),
    audioOut = require('./audio_out.js'); 

function AirTunes() {
  var self = this;

  Stream.call(this);

  devices.init();
  devices.on('status', function(key, status, desc) {
    self.emit('device', key, status, desc);
  });

  circularBuffer.on('status', function(status) {
    self.emit('buffer', status);
  });

  audioOut.init(devices);

  circularBuffer.on('drain', function() {
    self.emit('drain');
  });

  circularBuffer.on('error', function(err) {
    self.emit('error', err);
  });

  this.writable = true;
}

util.inherits(AirTunes, Stream);

AirTunes.prototype.add = function(host, options) {
  return devices.add('airtunes', host, options);
};

AirTunes.prototype.addCoreAudio = function(options) {
  return devices.add('coreaudio', null, options);
};

AirTunes.prototype.stopAll = function(cb) {
  devices.stopAll(cb);
};

AirTunes.prototype.setVolume = function(deviceKey, volume, callback) {
  devices.setVolume(deviceKey, volume, callback);
};

AirTunes.prototype.setTrackInfo = function(deviceKey, name, artist, album, callback) {
  devices.setTrackInfo(deviceKey, name, artist, album, callback);
};

AirTunes.prototype.reset = function() {
	circularBuffer.reset();
};

AirTunes.prototype.setArtwork = function(deviceKey, art, contentType, callback) {
  devices.setArtwork(deviceKey, art, contentType, callback);
};

AirTunes.prototype.write = function(data) {
  return circularBuffer.write(data);
};

AirTunes.prototype.end = function() {
  circularBuffer.end();
};

module.exports = new AirTunes();<commit_msg>Add contructor to module.exports<commit_after>var Stream = require('stream'),
    util = require('util'),
    devices = require('./devices.js'),
    circularBuffer = require('./circular_buffer.js'),
    audioOut = require('./audio_out.js'); 

function AirTunes() {
  var self = this;

  Stream.call(this);

  devices.init();
  devices.on('status', function(key, status, desc) {
    self.emit('device', key, status, desc);
  });

  circularBuffer.on('status', function(status) {
    self.emit('buffer', status);
  });

  audioOut.init(devices);

  circularBuffer.on('drain', function() {
    self.emit('drain');
  });

  circularBuffer.on('error', function(err) {
    self.emit('error', err);
  });

  this.writable = true;
}

util.inherits(AirTunes, Stream);

AirTunes.prototype.add = function(host, options) {
  return devices.add('airtunes', host, options);
};

AirTunes.prototype.addCoreAudio = function(options) {
  return devices.add('coreaudio', null, options);
};

AirTunes.prototype.stopAll = function(cb) {
  devices.stopAll(cb);
};

AirTunes.prototype.setVolume = function(deviceKey, volume, callback) {
  devices.setVolume(deviceKey, volume, callback);
};

AirTunes.prototype.setTrackInfo = function(deviceKey, name, artist, album, callback) {
  devices.setTrackInfo(deviceKey, name, artist, album, callback);
};

AirTunes.prototype.reset = function() {
	circularBuffer.reset();
};

AirTunes.prototype.setArtwork = function(deviceKey, art, contentType, callback) {
  devices.setArtwork(deviceKey, art, contentType, callback);
};

AirTunes.prototype.write = function(data) {
  return circularBuffer.write(data);
};

AirTunes.prototype.end = function() {
  circularBuffer.end();
};

module.exports = new AirTunes();
module.exports.AirTunes = AirTunes;
{'fraction_non_alphanumeric': 0.1647907647907648, 'fraction_numerical': 0.0, 'mean_word_length': 4.934931506849315, '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': '857085', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1112, 'n_words': 200}