<commit_before>function Scoreboard(options) {
  if (!options) options= {};

  this._message = options.message || '';
  this._score = options.score || 0;

  if (options.onTimeExpired) {
    this._countdown = new __Countdown({
      duration: options.countDownFrom
    });
    this.onTimeExpired(
      options.onTimeExpired ? options.onTimeExpired : function(){}
    );
  }
}

/****
 * Message
 */
Scoreboard.prototype.showMessage = function() {
  this.ensureDom();
  this.message_el.style.display = 'block';
  return this;
};

Scoreboard.prototype.hideMessage = function() {
  this.message_el.style.display = 'none';
  return this;
};

Scoreboard.prototype.clearMessage = function() {
  this.setMessage();
  return this;
};

Scoreboard.prototype.setMessage = function(message) {
  if (!message) message = '';

  this.showMessage();
  this._message = message;
  this.message_el.innerHTML = this._message;

  this.message_el.scrollTop = this.message_el.scrollHeight;

  return this;
};

Scoreboard.prototype.appendMessage = function(message) {
  function div(s) { return '<div>' + s + '</div>'; }
  this.setMessage((this._message || '') + div(message));
  return this;
};

Scoreboard.prototype.addMessage = Scoreboard.prototype.appendMessage;
Scoreboard.prototype.message = Scoreboard.prototype.appendMessage;

// Message

/*****
 * Help
 */
Scoreboard.prototype.showHelp = function() {
  this.ensureDom();
  this.help_el.style.display = 'block';
  return this;
};

Scoreboard.prototype.hideHelp = function() {
  this.help_el.style.display = 'none';
  return this;
};

Scoreboard.prototype.toggleHelp = function() {
  this.help_el.style.display = this.help_el.style.display == 'none' ?
    'block' : 'none';
  return this;
};

Scoreboard.prototype.showHelpFooter = function() {
  this.ensureDom();
  this.help_footer.style.display = 'block';
  return this;
};

Scoreboard.prototype.setHelp = function(help) {
  this.showHelpFooter();
  this._help = help;
  this.help_el.innerHTML = this._help;

  this.help_el.scrollTop = this.help_el.scrollHeight;

  return this;
};

Scoreboard.prototype.addHelp = Scoreboard.prototype.setHelp;
Scoreboard.prototype.help = Scoreboard.prototype.setHelp;

// Help

/****
 * Score
 */

Scoreboard.prototype.showScore = function() {
  this.ensureDom();
  this.score_el.style.display = 'block';
  return this;
};


Scoreboard.prototype.setScore = function(score) {
  this.showScore();
  this._score = score;
<commit_msg>Better default behavior<commit_after>function Scoreboard(options) {
  if (!options) options= {};

  this._message = options.message || '';
  this._score = options.score || 0;

  if (options.onTimeExpired) {
    this._countdown = new __Countdown({
      duration: options.countDownFrom
    });
    this.onTimeExpired(
      options.onTimeExpired ? options.onTimeExpired : function(){}
    );
  }
}

/****
 * Message
 */
Scoreboard.prototype.showMessage = function() {
  this.ensureDom();
  this.message_el.style.display = 'block';
  return this;
};

Scoreboard.prototype.hideMessage = function() {
  this.message_el.style.display = 'none';
  return this;
};

Scoreboard.prototype.clearMessage = function() {
  this.setMessage();
  return this;
};

Scoreboard.prototype.setMessage = function(message) {
  if (!message) message = '';

  this.showMessage();
  this._message = message;
  this.message_el.innerHTML = this._message;

  this.message_el.scrollTop = this.message_el.scrollHeight;

  return this;
};

Scoreboard.prototype.appendMessage = function(message) {
  function div(s) { return '<div>' + s + '</div>'; }
  this.setMessage((this._message || '') + div(message));
  return this;
};

Scoreboard.prototype.addMessage = Scoreboard.prototype.appendMessage;
Scoreboard.prototype.message = Scoreboard.prototype.setMessage;

// Message

/*****
 * Help
 */
Scoreboard.prototype.showHelp = function() {
  this.ensureDom();
  this.help_el.style.display = 'block';
  return this;
};

Scoreboard.prototype.hideHelp = function() {
  this.help_el.style.display = 'none';
  return this;
};

Scoreboard.prototype.toggleHelp = function() {
  this.help_el.style.display = this.help_el.style.display == 'none' ?
    'block' : 'none';
  return this;
};

Scoreboard.prototype.showHelpFooter = function() {
  this.ensureDom();
  this.help_footer.style.display = 'block';
  return this;
};

Scoreboard.prototype.setHelp = function(help) {
  this.showHelpFooter();
  this._help = help;
  this.help_el.innerHTML = this._help;

  this.help_el.scrollTop = this.help_el.scrollHeight;

  return this;
};

Scoreboard.prototype.addHelp = Scoreboard.prototype.setHelp;
Scoreboard.prototype.help = Scoreboard.prototype.setHelp;

// Help

/****
 * Score
 */

Scoreboard.prototype.showScore = function() {
  this.ensureDom();
  this.score_el.style.display = 'block';
  return this;
};


Scoreboard.prototype.setScore = function(score) {
  this.showScore();
  this._score = score || 0;

{'fraction_non_alphanumeric': 0.15199674001629992, 'fraction_numerical': 0.0006112469437652812, 'mean_word_length': 4.108220603537982, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3162811', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1572, 'n_words': 263}