<commit_before>class EventGroupsController < ApplicationController
  layout 'whoops'
  before_filter :update_event_group_filter
  helper_method :event_group_filter
  
  def index
    finder = if params[:query].blank?
      Whoops::EventGroup.where(event_group_filter.to_query_document)
    else
      Whoops::EventGroup.where(:_id.in => Whoops::Event.where(:keywords => /#{params[:query]}/i).collect{|e| e.event_group_id}.uniq)
    end
    
    @event_groups = finder.desc(:last_recorded_at).page(params[:page]).per(2)
    
    respond_to do |format|
      format.html
      format.js { render :partial => 'list' }
    end
  end
  
  def show
    @event_group = Whoops::EventGroup.find(params[:id])
  end
  
  def update_event_group_filter
    self.event_group_filter = params[:whoops_filter] if params[:updating_filters]
  end
  
  def event_group_filter
    session[:event_group_filter] ||= Whoops::Filter.new
  end
  
  def event_group_filter=(filter)
    session[:event_group_filter] = Whoops::Filter.new_from_params(filter)
  end
  
end
<commit_msg>using the right number of events per page<commit_after>class EventGroupsController < ApplicationController
  layout 'whoops'
  before_filter :update_event_group_filter
  helper_method :event_group_filter
  
  def index
    finder = if params[:query].blank?
      Whoops::EventGroup.where(event_group_filter.to_query_document)
    else
      Whoops::EventGroup.where(:_id.in => Whoops::Event.where(:keywords => /#{params[:query]}/i).collect{|e| e.event_group_id}.uniq)
    end
    
    @event_groups = finder.desc(:last_recorded_at).page(params[:page]).per(30)
    
    respond_to do |format|
      format.html
      format.js { render :partial => 'list' }
    end
  end
  
  def show
    @event_group = Whoops::EventGroup.find(params[:id])
  end
  
  def update_event_group_filter
    self.event_group_filter = params[:whoops_filter] if params[:updating_filters]
  end
  
  def event_group_filter
    session[:event_group_filter] ||= Whoops::Filter.new
  end
  
  def event_group_filter=(filter)
    session[:event_group_filter] = Whoops::Filter.new_from_params(filter)
  end
  
end

{'fraction_non_alphanumeric': 0.10949929808142256, 'fraction_numerical': 0.0014038371548900327, 'mean_word_length': 4.09047619047619, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1999767', 'n_tokens_mistral': 715, 'n_tokens_neox': 705, 'n_words': 119}