<commit_before>function parseFen($elem) {
  if (!$elem || !$elem.jquery) {
    $elem = $('.parse_fen');
  }
  $elem.each(function() {
    var $this = $(this).removeClass('parse_fen');
    var lm = $this.data('lastmove');
    var color = $this.data('color');
    var ground = $this.data('chessground');
    var config = {
      coordinates: false,
      resizable: false,
      drawable: { enabled: false, visible: false },
      viewOnly: true,
      fen: $this.data('fen'),
      lastMove: lm && [lm[0] + lm[1], lm[2] + lm[3]]
    };
    if (color) config.orientation = color;
    if (ground) ground.set(config);
    else {
      this.innerHTML = '<div class="cg-board-wrap"></div>';
      $this.data('chessground', Chessground(this.firstChild, config));
    }
  });
}

function resize() {
  var el = document.querySelector('#featured-game');
  if (el.offsetHeight > window.innerHeight)
    el.style.maxWidth = (window.innerHeight - el.querySelector('.vstext').offsetHeight) + 'px';
}

$(function() {
  var $featured = $('#featured-game');
  var board = function() {
    return $featured.find('.mini-board');
  };
  parseFen(board());
  if (!window.EventSource) return;
  var source = new EventSource($('body').data('stream-url'));
  source.addEventListener('message', function(e) {
    var data = JSON.parse(e.data);
    if (data.t == "featured") {
      $featured.html(data.d.html).find('a').attr('target', '_blank');
      parseFen(board());
    } else if (data.t == "fen") {
      parseFen(board().data("fen", data.d.fen).data("lastmove", data.d.lm));
    }
  }, false);
  resize();
  window.addEventListener('resize', resize);
});
<commit_msg>fix TV frame<commit_after>function parseFen($elem) {
  $elem.each(function() {
    var $this = $(this).removeClass('parse-fen');
    var lm = $this.data('lastmove');
    var color = $this.data('color');
    var ground = $this.data('chessground');
    var config = {
      coordinates: false,
      resizable: false,
      drawable: { enabled: false, visible: false },
      viewOnly: true,
      fen: $this.data('fen'),
      lastMove: lm && [lm[0] + lm[1], lm[2] + lm[3]]
    };
    if (color) config.orientation = color;
    if (ground) ground.set(config);
    else {
      this.innerHTML = '<div class="cg-board-wrap"></div>';
      $this.data('chessground', Chessground(this.firstChild, config));
    }
  });
}

function resize() {
  var el = document.querySelector('#featured-game');
  if (el.offsetHeight > window.innerHeight)
    el.style.maxWidth = (window.innerHeight - el.querySelector('.vstext').offsetHeight) + 'px';
}

$(function() {
  var $featured = $('#featured-game');
  var board = function() {
    return $featured.find('.mini-board');
  };
  parseFen(board());
  if (!window.EventSource) return;
  var source = new EventSource($('body').data('stream-url'));
  source.addEventListener('message', function(e) {
    var data = JSON.parse(e.data);
    if (data.t == "featured") {
      $featured.html(data.d.html).find('a').attr('target', '_blank');
      parseFen(board());
    } else if (data.t == "fen") {
      parseFen(board().data("fen", data.d.fen).data("lastmove", data.d.lm));
    }
  }, false);
  resize();
  window.addEventListener('resize', resize);
});

{'fraction_non_alphanumeric': 0.20396162178891983, 'fraction_numerical': 0.0024760136180748994, 'mean_word_length': 3.4334705075445817, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3196232', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1089, 'n_words': 209}