<commit_before>var players;
var currentMatch;
var matches;
var currentFrame;

$(document).ready(function() {
  players = new Players();
  players.fetch({dataType: 'jsonp', success: matchFetch});
});

function matchFetch() {
  matches = new Matches();
  matches.fetch({dataType: 'jsonp', success: frameFetch});
}

function frameFetch() {
  currentFrame = new Frame();
  fetchFrameWithNoWinner();
  self.setInterval(function(){
    refresh();
  },10000);
}

function refresh() {
  fetchFrameWithNoWinner();
}

function fetchStrikes() {
  currentFrame.fetchStrikes({
    dataType: 'jsonp',
    success: function() {
      currentFrame.initStrikes();
      var strikeHistoryView = new StrikesView({collection: currentFrame.get('strikes'), el: '#strikeHistory'});
      strikeHistoryView.render();
    }
  });
}

function fetchFrameWithNoWinner() {
  var frames = new Frames();
  var frame_template = Handlebars.compile($('#frame-tmpl').html());
  var options = {};
  var data = (options.data || {});
  options.data = {winner__isnull: true, limit: 1};
  options.dataType = 'jsonp';
  options.success = function (collection) {
    currentFrame = collection.first();
    var frameView = new FrameView({model: currentFrame, el: '#currentFrame', 
        template: frame_template});
    frameView.render();
    fetchStrikes();
  };
  frames.fetch(options);
}
<commit_msg>client naming fixed<commit_after>var players;
var currentMatch;
var matches;
var currentFrame;

$(document).ready(function() {
  players = new Players();
  players.fetch({dataType: 'jsonp', success: matchFetch});
});

function matchFetch() {
  matches = new Matches();
  matches.fetch({dataType: 'jsonp', success: frameFetch});
}

function frameFetch() {
  currentFrame = new Frame();
  fetchFrameWithNoWinner();
  self.setInterval(function(){
    refresh();
  },10000);
}

function refresh() {
  fetchFrameWithNoWinner();
}

function fetchStrikes() {
  currentFrame.fetchStrikes({
    dataType: 'jsonp',
    success: function() {
      currentFrame.initStrikes();
      var strikeHistoryView = new StrikesView({collection: currentFrame.get('strikes'), el: '#strikeHistory'});
      strikeHistoryView.render();
    }
  });
}

function fetchFrameWithNoWinner() {
  var frames = new Frames();
  var frame_template = Handlebars.compile($('#frame-tmpl').html());
  var options = {};
  var data = (options.data || {});
  options.data = {winner__isnull: true, limit: 1};
  options.dataType = 'jsonp';
  options.success = function (collection) {
    if (collection.size() == 0) {
      noFramesInProgress();
    }
    else {
      currentFrame.fetchRelated('match');
      currentFrame = collection.first();
      var frameView = new FrameView({model: currentFrame, el: '#currentFrame', 
          template: frame_template});
      frameView.render();
      fetchStrikes();
    }
  };
  frames.fetch(options);
}

function noFramesInProgress() {
  $('#currentFrame').html('No frames in progress.');
  $('#strikeHistory').html('');
}

{'fraction_non_alphanumeric': 0.15835286240374957, 'fraction_numerical': 0.004352192835621024, 'mean_word_length': 4.288495575221239, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6917723', 'n_tokens_mistral': 925, 'n_tokens_neox': 912, 'n_words': 197}