<commit_before>var net = require("net");

var Q = require("q");

var fics_host = "freechess.org";
var fics_port = 5000;

var FICSClient = function() {
  this.socket = net.connect({ port: fics_port, host: fics_host });
  this.deferred = Q.defer();

  var self = this;
  this.socket.on("data", function(data) {
    self.deferred.notify(data.toString());
  });
};

FICSClient.prototype.__defineGetter__("promise", function() {
  return this.deferred.promise;
});

FICSClient.prototype.send_message = function(message) {
  this.socket.write(message + "\n", "utf8");
}

FICSClient.prototype.login = function(user_data) {
  if (user_data.login) {
    var username = user_data.login;
    var password = <PASSWORD>;
  } else {
    var username = "guest";
  }

  var self = this;
  this.promise.then(null, null, function(data) {
    if (data.match(/login:/)) {
      self.send_message(username);
    }

    if (data.match(/password:/)) {
      self.send_message(password);<commit_msg>always type next when prompted<commit_after>var net = require("net");

var Q = require("q");

var fics_host = "freechess.org";
var fics_port = 5000;

var FICSClient = function() {
  this.socket = net.connect({ port: fics_port, host: fics_host });
  this.deferred = Q.defer();

  var self = this;
  this.socket.on("data", function(data) {
    self.deferred.notify(data.toString());
  });

  this.promise.then(null, null, function(data) {
    if (data.match(/Type \[next\] to see next page\./)) {
      self.send_message("next");
    }
  });
};

FICSClient.prototype.__defineGetter__("promise", function() {
  return this.deferred.promise;
});

FICSClient.prototype.send_message = function(message) {
  this.socket.write(message + "\n", "utf8");
}

FICSClient.prototype.login = function(user_data) {
  if (user_data.login) {
    var username = user_data.login;
    var password = user_data.password;
  } else {
    var username = "guest";
  }

  var self = this;
  this.promise.then(null, null, function(data) {
    if (data.match(/login:/)) {
      self.send_message(username);
    }

    if (data.match(/password:/)) {
      self.send_message(password);
{'fraction_non_alphanumeric': 0.16682330827067668, 'fraction_numerical': 0.004699248120300752, 'mean_word_length': 3.6894273127753303, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3782039', 'n_tokens_mistral': 755, 'n_tokens_neox': 736, 'n_words': 142}