<commit_before><p><a href="/stations" class="text-muted"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> Back to list</a></p>

<%= erb :'includes/crowding_form' %>

<h2>Next <%= params[:direction] %> trains at <%= I18n.t "stations.#{db_signal params[:station]}" %></h2>

<%= erb :'includes/train' %>

<script>
$.getJSON(document.URL, function(data) {
  if (data[0]) {
    $('#car-a-f .num').text(percentage(data[0][1].CAR_A))
    $('#car-b-f .num').text(percentage(data[0][1].CAR_B))
    $('#car-c-f .num').text(percentage(data[0][1].CAR_C))
    $('#car-d-f .num').text(percentage(data[0][1].CAR_D))

    setHeight('#car-a-f .level', data[0][1].CAR_A)
    setHeight('#car-b-f .level', data[0][1].CAR_B)
    setHeight('#car-c-f .level', data[0][1].CAR_C)
    setHeight('#car-d-f .level', data[0][1].CAR_D)
  }
})

function setHeight(el, num) {
  $(el).height(percentage(num))
  if (num >= 100) {
    $(el).addClass('overloaded')
  }
}

function percentage(num) {
  return Math.round(num) + '%'
}

function valBetween(v, min, max) {
  return (Math.min(max, Math.max(min, v)));
}

$(function() {
  callDatePicker()
})
</script><commit_msg>Populate train<commit_after><p><a href="/stations" class="text-muted"><span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> Back to list</a></p>

<%= erb :'includes/crowding_form' %>

<h2>Next <%= params[:direction] %> trains at <%= I18n.t "stations.#{db_signal params[:station]}" %></h2>

<%= erb :'includes/train' %>

<script>
$.getJSON(document.URL, function(data) {
  if (data[0]) {
    $.each(['f', 'r'], function(index, value) {
    $('#car-a-' + value + ' .num').text(percentage(data[0][1].CAR_A))
    $('#car-b-' + value + ' .num').text(percentage(data[0][1].CAR_B))
    $('#car-c-' + value + ' .num').text(percentage(data[0][1].CAR_C))
    $('#car-d-' + value + ' .num').text(percentage(data[0][1].CAR_D))

    setHeight('#car-a-' + value + ' .level', data[0][1].CAR_A)
    setHeight('#car-b-' + value + ' .level', data[0][1].CAR_B)
    setHeight('#car-c-' + value + ' .level', data[0][1].CAR_C)
    setHeight('#car-d-' + value + ' .level', data[0][1].CAR_D)
  })
  }
})

function setHeight(el, num) {
  $(el).height(percentage(num))
  if (num >= 100) {
    $(el).addClass('overloaded')
  }
}

function percentage(num) {
  return Math.round(num) + '%'
}

function valBetween(v, min, max) {
  return (Math.min(max, Math.max(min, v)));
}

$(function() {
  callDatePicker()
})
</script>
{'fraction_non_alphanumeric': 0.2613452188006483, 'fraction_numerical': 0.019448946515397084, 'mean_word_length': 4.28693790149893, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 33, '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': '3469540', 'n_tokens_mistral': 1042, 'n_tokens_neox': 991, 'n_words': 150}