<commit_before>class TTCCard extends HTMLElement {
  setConfig(config) {
    if (!config.entity) {
      throw new Error('Please specify an entity');
    }

    this._config = config;
  }

  set hass(hass) {
    if (!this.content) {
      var card = document.createElement('ha-card');
      this.content = document.createElement('div');
      this.content.id = 'wrapper';
      card.appendChild(this.content);
      this.appendChild(card);
    }

    var data = hass.states[this._config.entity]
    var predictions = (data.attributes.prediction) ?
      data.attributes.prediction.map(function (pred) {
      var rawSeconds = parseInt(pred.seconds);
      var minutes = Math.floor(rawSeconds / 60);
      var seconds = ("0" + (rawSeconds - minutes)).substring(0, 2);
      return `
        <div class="prediction">
          ${minutes}:${seconds}
        </div>
      `;
    }) : [];

    this.content.innerHTML = `
      <style>
        .outer {
          padding: 1px 16px 16px;
        }
        .predictions {
          display: flex;
          justify-content: space-between;
        }
        .prediction {
          font-size: 2em;
        }
      </style>

      <div class="outer">
        <h3>${data.attributes.routeTitle}</h3>
        <div class="predictions">
          ${predictions.join(' ')}
        </div>
      </div>
    `
  }
<commit_msg>only show 4 TTC predictions max<commit_after>class TTCCard extends HTMLElement {
  setConfig(config) {
    if (!config.entity) {
      throw new Error('Please specify an entity');
    }

    this._config = config;
  }

  set hass(hass) {
    if (!this.content) {
      var card = document.createElement('ha-card');
      this.content = document.createElement('div');
      this.content.id = 'wrapper';
      card.appendChild(this.content);
      this.appendChild(card);
    }

    var data = hass.states[this._config.entity]
    var predictions = (data.attributes.prediction) ?
      data.attributes.prediction.map(function (pred, index) {
        if (index > 3) {
          return '';
        }
        var rawSeconds = parseInt(pred.seconds);
        var minutes = Math.floor(rawSeconds / 60);
        var seconds = ("0" + (rawSeconds - minutes)).substring(0, 2);
        return `
          <div class="prediction">
            ${minutes}:${seconds}
          </div>
        `;
      }) :
      [];

    this.content.innerHTML = `
      <style>
        .outer {
          padding: 1px 16px 16px;
        }
        .predictions {
          display: flex;
          justify-content: space-between;
        }
        .prediction {
          font-size: 2em;
        }
      </style>

      <div class="outer">
        <h3>${data.attributes.routeTitle}</h3>
        <div class="predictions">
          ${predictions.join(' ')}
        </div>
      </div>
    `
  }

{'fraction_non_alphanumeric': 0.14153955303299043, 'fraction_numerical': 0.009932600212841433, 'mean_word_length': 1.8982528263103802, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 24, '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': '7452869', 'n_tokens_mistral': 867, 'n_tokens_neox': 839, 'n_words': 166}