<commit_before><h2><%= @poll.name %></h2>
<div class="poll-meta">
  <p>
    Poll started <%= @poll.created_at %> by <%= @poll.starter.username %>.
    <% unless @poll.ended_at.nil? %>
      <br>
      Poll closed <%= @poll.ended_at %>.
    <% end %>
  </p>
  <%
  links = []
  if @poll.open? && can?(:nominate, @poll)
    links << link_to("Nominate places", nominate_poll_path(@poll))
  end

  if @poll.open? && can?(:close, @poll)
    links << link_to("Close poll", close_poll_path(@poll), confirm: "Are you sure you want to close this poll?", method: :put)
  end

  if can? :destroy, @poll
    links << link_to("Delete poll", poll_path(@poll), confirm: "Are you sure you want to delete this poll?", method: :delete)
  end
  %>
  <% unless links.empty? %>
    <div>
      <%= raw links.join(" | ") %>
    </div>
  <% end %>
</div>

<% user_votes = current_user.nil? ? [] : @votes_by_user[current_user.id] %>

<% if @poll.open? %>
  <% active_tab = user_votes.count >= @poll.max_votes_per_user ? "results" : "vote" %>
<% else %>
  <% active_tab = "results" %>
<% end %>

<ul class="nav nav-tabs">
  <% ["vote", "participation", "results"].each do |tab| %>
    <li class="<%= "active" if active_tab == tab %>"><a href="#<%= tab %>" data-toggle="tab"><%= tab.titleize %></a></li>
  <% end %>
</ul>

<div class="tab-content">
  <div class="tab-pane<%= " active" if active_tab == "vote" %>" id="vote">
    <% unless @poll.poll_options.empty? %>
      <%= form_tag vote_poll_path @poll do %>
        <% @poll.poll_options.each do |opt| %>
          <% if can? :vote, @poll %><commit_msg>Fix user_vote reference bug that occurred when the current user had not yet voted<commit_after><h2><%= @poll.name %></h2>
<div class="poll-meta">
  <p>
    Poll started <%= @poll.created_at %> by <%= @poll.starter.username %>.
    <% unless @poll.ended_at.nil? %>
      <br>
      Poll closed <%= @poll.ended_at %>.
    <% end %>
  </p>
  <%
  links = []
  if @poll.open? && can?(:nominate, @poll)
    links << link_to("Nominate places", nominate_poll_path(@poll))
  end

  if @poll.open? && can?(:close, @poll)
    links << link_to("Close poll", close_poll_path(@poll), confirm: "Are you sure you want to close this poll?", method: :put)
  end

  if can? :destroy, @poll
    links << link_to("Delete poll", poll_path(@poll), confirm: "Are you sure you want to delete this poll?", method: :delete)
  end
  %>
  <% unless links.empty? %>
    <div>
      <%= raw links.join(" | ") %>
    </div>
  <% end %>
</div>

<% unless current_user.nil? %>
  <% user_votes = @votes_by_user[current_user.id] %>
<% end %>

<% if user_votes.nil? %>
  <% user_votes = [] %>
<% end %>

<% if @poll.open? %>
  <% active_tab = user_votes.count >= @poll.max_votes_per_user ? "results" : "vote" %>
<% else %>
  <% active_tab = "results" %>
<% end %>

<ul class="nav nav-tabs">
  <% ["vote", "participation", "results"].each do |tab| %>
    <li class="<%= "active" if active_tab == tab %>"><a href="#<%= tab %>" data-toggle="tab"><%= tab.titleize %></a></li>
  <% end %>
</ul>

<div class="tab-content">
  <div class="tab-pane<%= " active" if active_tab == "vote" %>" id="vote">
    <% unless @poll.poll_options.empty? %>
      <%= form_tag vote_poll_path @poll do %>
        <% @poll.poll_options.each do |opt| %>
          <% if can? :vote, @poll %>
{'fraction_non_alphanumeric': 0.21963746223564953, 'fraction_numerical': 0.0012084592145015106, 'mean_word_length': 3.3738441215323647, 'pattern_counts': {'":': 0, '<': 106, '<?xml version=': 0, '>': 96, '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': '4013119', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1197, 'n_words': 293}