<commit_before>(function(){
  window.Experiment = function(experimentName, experimentClass) {
    this.EXPERIMENT_NAME = experimentName;
    this.variants = [];
    this.experimentClass = experimentClass;

    this.addVariant = function(name, weight) {
      this.variants.push({
        experiment_name: this.EXPERIMENT_NAME,
        name: name,
        weight: weight
      })
    }

    this.chooseVariant = function() {
      var savedVariant = window.localStorage.getItem(this.EXPERIMENT_NAME);
      if(savedVariant) { return savedVariant }

      // Use a CDF to select a variant based on weight.<commit_msg>Add alert to prevent future devs from assigning non-integer weights<commit_after>(function(){
  window.Experiment = function(experimentName, experimentClass) {
    this.EXPERIMENT_NAME = experimentName;
    this.variants = [];
    this.experimentClass = experimentClass;

    this.addVariant = function(name, weight) {
      if(weight < 1) { return alert('Snowplow requires weights to be integers.'); }
      this.variants.push({
        experiment_name: this.EXPERIMENT_NAME,
        name: name,
        weight: weight
      })
    }

    this.chooseVariant = function() {
      var savedVariant = window.localStorage.getItem(this.EXPERIMENT_NAME);
      if(savedVariant) { return savedVariant }

      // Use a CDF to select a variant based on weight.
{'fraction_non_alphanumeric': 0.09941520467836257, 'fraction_numerical': 0.0007309941520467836, 'mean_word_length': 3.1484848484848484, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6690917', 'n_tokens_mistral': 394, 'n_tokens_neox': 386, 'n_words': 91}