<commit_before>function Thermostat() {
  this.temperature = 20;
  this.powerSaving = true;
  this.maximumTemperature = 25
  this.minimumTemperature = 10;
  this.currentEnergyUsage = "yellow"

};

Thermostat.prototype.increaseTemperature = function() {
  if(this.temperature === this.maximumTemperature) {
    throw new Error("Cannot increase above 25 degrees!")
  }
  this.temperature += 1;
  this._energyUsage();
};

Thermostat.prototype.decreaseTemperature = function () {
  if(this.temperature === 10) {
    throw new Error("Cannot decrease below 10 degrees!");
  }
    this.temperature -= 1;
    this._energyUsage();
};

Thermostat.prototype.switchPowerSaving = function() {
  if(this.powerSaving === true) {
  this.powerSaving = false;
  this.maximumTemperature = 32;
} else {
  this.powerSaving = true;
  this.maximumTemperature = 25;
  };
};

Thermostat.prototype.reset = function () {
  this.temperature = 20;
};

Thermostat.prototype._energyUsage = function() {
  if (this.temperature < 18) {
    this.currentEnergyUsage = 'green';
  } else if(this.temperature > 25){
    this.currentEnergyUsage = 'red';
  } else {
    this.currentEnergyUsage = 'yellow';
  };
};<commit_msg>Removed some magic numbers<commit_after>function Thermostat() {
  this.DEFAULT_TEMP = 20;
  this.MEDIUM_USAGE_LIMIT = 25;
  this.LOW_USAGE_LIMIT = 18;
  this.temperature = this.DEFAULT_TEMP;
  this.powerSaving = true;
  this.maximumTemperature = 25
  this.minimumTemperature = 10;
  this.currentEnergyUsage = "yellow"

};

Thermostat.prototype.increaseTemperature = function() {
  if(this.temperature === this.maximumTemperature) {
    throw new Error("Cannot increase above 25 degrees!")
  }
  this.temperature += 1;
  this._energyUsage();
};

Thermostat.prototype.decreaseTemperature = function () {
  if(this.temperature === 10) {
    throw new Error("Cannot decrease below 10 degrees!");
  }
    this.temperature -= 1;
    this._energyUsage();
};

Thermostat.prototype.switchPowerSaving = function() {
  if(this.powerSaving === true) {
  this.powerSaving = false;
  this.maximumTemperature = 32;
} else {
  this.powerSaving = true;
  this.maximumTemperature = 25;
  };
};

Thermostat.prototype.reset = function () {
  this.temperature = this.DEFAULT_TEMP;
};

Thermostat.prototype._energyUsage = function() {
  if (this.temperature < this.LOW_USAGE_LIMIT) {
    this.currentEnergyUsage = 'green';
  } else if(this.temperature > this.MEDIUM_USAGE_LIMIT){
    this.currentEnergyUsage = 'red';
  } else {
    this.currentEnergyUsage = 'yellow';
  };
};
{'fraction_non_alphanumeric': 0.13362238864800946, 'fraction_numerical': 0.018131651556957035, 'mean_word_length': 4.116935483870968, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6228244', 'n_tokens_mistral': 903, 'n_tokens_neox': 811, 'n_words': 153}