<commit_before><div class="col-md-<%= @cols %> col-sm-<%= @cols+1 %> text-center agent">

  <div class="agent-id">
    <div class="agent-image">
      <%= link_to avatar_image(agent_stats.assigned_user, size=80), admin_user_path(id: agent_stats.assigned_user_id) if agent_stats.assigned_user.present? %>
    </div>
    <div class="agent-name">
      <% topic_count = @topics.where(assigned_user: agent_stats.assigned_user).count %>
      <h3>
        <%= agent_stats.assigned_user.try(:name).split(' ')[0].titleize || 'No Agent'.html_safe %><br/>
        <small><%= agent_stats.assigned_user.try(:role).titleize %></small>
      </h3>
    </div>
  </div>

  <div class="agent-assigned-count agent-stat">
    <h4><%= topic_count.zero? ? '-' : topic_count %><br/>
    <small>Assigned Topics</small>
  </div>

  <div class="agent-responded agent-stat">
    <% responded_topic_count = @responded_topics.where(assigned_user: agent_stats.assigned_user).length %>
    <h4 title="Responded to <%= responded_topic_count %> / <%= topic_count %>">
      <% if topic_count.zero? %>
        -
      <% else %>
        <%= number_to_percentage(responded_topic_count.to_f / topic_count.to_f * 100.00, precision: 1)  %>
      <% end %>
      <br/>
      <small>Responded</small>
    </h4>
  </div>

  <div class="agent-closed agent-stat">
    <% closed_topic_count = Topic.undeleted.where(user: agent_stats.assigned_user).closed.count %>
    <h4 title="<%= closed_topic_count %> / <%= topic_count %> Closed">
      <% if topic_count.zero? %>
        -
      <% else %>
        <%= number_to_percentage(closed_topic_count.to_f / topic_count.to_f * 100.00, precision: 1)  %>
      <% end %>
      <br/>
      <small>Closed</small>
    </h4>
  </div>

  <div class="agent-replies agent-stat">
    <% posts_count = @posts.where(user: agent_stats.assigned_user, kind: 'reply').count %>
    <h4><%= posts_count.zero? ? '-' : posts_count %>
    <br/><small>Replies</small></h4>
  </div>

  <div class="agent-response-time agent-stat">
    <% delays = @responded_topics.where(assigned_user: agent_stats.assigned_user).map { |t| t.posts.second.created_at - t.created_at } %>
    <h4>
      <% if delays.empty? %>
        N/A<commit_msg>Fix closed topic count filter<commit_after><div class="col-md-<%= @cols %> col-sm-<%= @cols+1 %> text-center agent">

  <div class="agent-id">
    <div class="agent-image">
      <%= link_to avatar_image(agent_stats.assigned_user, size=80), admin_user_path(id: agent_stats.assigned_user_id) if agent_stats.assigned_user.present? %>
    </div>
    <div class="agent-name">
      <% topic_count = @topics.where(assigned_user: agent_stats.assigned_user).count %>
      <h3>
        <%= agent_stats.assigned_user.try(:name).split(' ')[0].titleize || 'No Agent'.html_safe %><br/>
        <small><%= agent_stats.assigned_user.try(:role).titleize %></small>
      </h3>
    </div>
  </div>

  <div class="agent-assigned-count agent-stat">
    <h4><%= topic_count.zero? ? '-' : topic_count %><br/>
    <small>Assigned Topics</small>
  </div>

  <div class="agent-responded agent-stat">
    <% responded_topic_count = @responded_topics.where(assigned_user: agent_stats.assigned_user).length %>
    <h4 title="Responded to <%= responded_topic_count %> / <%= topic_count %>">
      <% if topic_count.zero? %>
        -
      <% else %>
        <%= number_to_percentage(responded_topic_count.to_f / topic_count.to_f * 100.00, precision: 1)  %>
      <% end %>
      <br/>
      <small>Responded</small>
    </h4>
  </div>

  <div class="agent-closed agent-stat">
    <% closed_topic_count = Topic.undeleted.where(assigned_user: agent_stats.assigned_user).closed.count %>
    <h4 title="<%= closed_topic_count %> / <%= topic_count %> Closed">
      <% if topic_count.zero? %>
        -
      <% else %>
        <%= number_to_percentage(closed_topic_count.to_f / topic_count.to_f * 100.00, precision: 1)  %>
      <% end %>
      <br/>
      <small>Closed</small>
    </h4>
  </div>

  <div class="agent-replies agent-stat">
    <% posts_count = @posts.where(user: agent_stats.assigned_user, kind: 'reply').count %>
    <h4><%= posts_count.zero? ? '-' : posts_count %>
    <br/><small>Replies</small></h4>
  </div>

  <div class="agent-response-time agent-stat">
    <% delays = @responded_topics.where(assigned_user: agent_stats.assigned_user).map { |t| t.posts.second.created_at - t.created_at } %>
    <h4>
      <% if delays.empty? %>
        N/A
{'fraction_non_alphanumeric': 0.1839442320665617, 'fraction_numerical': 0.011693276366089498, 'mean_word_length': 3.2402287893231647, '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': '7241355', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1589, 'n_words': 243}