<commit_before><% if @trains == [] %>
	<p>Sorry, no train information for that journey</p>
	<p>Please note, this service works with direct journeys and trains scheduled in the next few hours</p>
<% end %>

<% if @trains and @trains != [] %>
	<table>
  <% if @departing %>
		<tr><th>Time</th><th>Destination</th><th>Status</th><th>Platform</th></tr>
		<% @trains['trainServices'].each do |train| %>
	    <% alert = ' style="color:#990000;font-weight:bold;"' if ((train['etd'] != 'On time') and (train['etd'] != 'Starts here')) %>
	    <%= "<tr#{alert}><td>#{train['std']}</td><td>#{train['destination'].last['locationName']}</td><td><a href=\"/service?service=#{train['serviceID']}\">#{train['etd']}</a></td><td>#{train['platform']}</td></tr>".html_safe %>
	  <% end %>
  <% else %>
		<tr><th>Time</th><th>Origin</th><th>Status</th><th>Platform</th></tr>
		<% @trains['trainServices'].each do |train| %>
	    <% alert = ' style="color:#990000;font-weight:bold;"' if (train['eta'] != 'On time') %>
	    <%= "<tr#{alert}><td>#{train['sta']}</td><td>#{train['origin'].last['locationName']}</td><td><a href=\"/service?service=#{train['serviceID']}\">#{train['eta']}</a></td><td>#{train['platform']}</td></tr>".html_safe %>
	  <% end %>
  <% end %>

	</table>
	<img src="/images/nre.png" alt="Powered by National Rail Enquiries">
<% end %><commit_msg>Fixes #272. Adds checks for nil trains<commit_after><% if @trains and @trains['trainServices'].nil? %>
	<p>Sorry, no train information for that journey</p>
	<p>Please note, this service works with direct journeys and trains scheduled in the next few hours</p>
<% end %>

<% if @trains and @trains != [] and @trains['trainServices'] %>
	<table>
  <% if @departing %>
		<tr><th>Time</th><th>Destination</th><th>Status</th><th>Platform</th></tr>
		<% @trains['trainServices'].each do |train| %>
	    <% alert = ' style="color:#990000;font-weight:bold;"' if ((train['etd'] != 'On time') and (train['etd'] != 'Starts here')) %>
	    <%= "<tr#{alert}><td>#{train['std']}</td><td>#{train['destination'].last['locationName']}</td><td><a href=\"/service?service=#{train['serviceID']}\">#{train['etd']}</a></td><td>#{train['platform']}</td></tr>".html_safe %>
	  <% end %>
  <% else %>
		<tr><th>Time</th><th>Origin</th><th>Status</th><th>Platform</th></tr>
		<% @trains['trainServices'].each do |train| %>
	    <% alert = ' style="color:#990000;font-weight:bold;"' if (train['eta'] != 'On time') %>
	    <%= "<tr#{alert}><td>#{train['sta']}</td><td>#{train['origin'].last['locationName']}</td><td><a href=\"/service?service=#{train['serviceID']}\">#{train['eta']}</a></td><td>#{train['platform']}</td></tr>".html_safe %>
	  <% end %>
  <% end %>

	</table>
	<img src="/images/nre.png" alt="Powered by National Rail Enquiries">
<% end %>
{'fraction_non_alphanumeric': 0.2886002886002886, 'fraction_numerical': 0.00974025974025974, 'mean_word_length': 5.649880095923262, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, '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': '2550270', 'n_tokens_mistral': 1076, 'n_tokens_neox': 998, 'n_words': 160}