<commit_before>var events
var fridayEvents
var saturdayEvents
var sundayEvents

var template
var lastHalf
var titleDate = document.getElementById('title-date')
var timetable = document.getElementById('timetable')

function showEvents (template, target, data) {
  var html = template(data)
  target.innerHTML += html
}

function pendingEvent (ev) {
  return !ev.done
}

function eventComparator (ev1, ev2) {
  if (ev1.done != ev2.done) return Number(ev2.done) - Number(ev1.done)
  return ev1.begin - ev2.begin
}

function renderTimetable () {<commit_msg>Improve event comparator for sorting<commit_after>var events
var fridayEvents
var saturdayEvents
var sundayEvents

var template
var lastHalf
var titleDate = document.getElementById('title-date')
var timetable = document.getElementById('timetable')

function showEvents (template, target, data) {
  var html = template(data)
  target.innerHTML += html
}

function pendingEvent (ev) {
  return !ev.done
}

function eventComparator (ev1, ev2) {
  return (
    (Number(ev2.done) - Number(ev1.done)) ||
    (ev1.begin - ev2.begin) ||
    (ev1.end - ev2.end) ||
    (ev2.title < ev1.title ? 1 : -1)
  )
}

function renderTimetable () {
{'fraction_non_alphanumeric': 0.11421319796954314, 'fraction_numerical': 0.01692047377326565, 'mean_word_length': 4.502325581395349, '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': '725677', 'n_tokens_mistral': 396, 'n_tokens_neox': 381, 'n_words': 102}