<commit_before>class FlagLogController < ApplicationController
  def index
    @individual_user = User.find(params[:user_id]) if params[:user_id].present?

    if @individual_user
      @applicable_flag_logs = @individual_user.flag_logs
    else
      @applicable_flag_logs = FlagLog.all
    end

    if params[:filter] == 'fps'
      @applicable_flag_logs = @applicable_flag_logs.includes(:post).where(:posts => {:is_tp => false}).where(:success => true)
    end

    @flag_logs = @applicable_flag_logs.order('flag_logs.created_at DESC').includes(:post => [:feedbacks => [:user, :api_key]]).includes(:post => [:reasons]).includes(:user).paginate(:page => params[:page], :per_page => 100)
    @sites = Site.where(:id => @flag_logs.map(&:post).map(&:site_id)).to_a
  end

  def by_post
    @individual_post = Post.find(params[:id])
    @flag_logs = @individual_post.flag_logs.order('created_at DESC').includes(:post => [:feedbacks => [:user, :api_key]]).includes(:post => [:reasons]).includes(:user).paginate(:page => params[:page], :per_page => 100)
    @sites = Site.where(:id => @flag_logs.map(&:post).map(&:site_id)).to_a
    render :index<commit_msg>Match true order flags where cast in<commit_after>class FlagLogController < ApplicationController
  def index
    @individual_user = User.find(params[:user_id]) if params[:user_id].present?

    if @individual_user
      @applicable_flag_logs = @individual_user.flag_logs
    else
      @applicable_flag_logs = FlagLog.all
    end

    if params[:filter] == 'fps'
      @applicable_flag_logs = @applicable_flag_logs.includes(:post).where(:posts => {:is_tp => false}).where(:success => true)
    end

    @flag_logs = @applicable_flag_logs.order('flag_logs.created_at DESC, flag_logs.id DESC').includes(:post => [:feedbacks => [:user, :api_key]]).includes(:post => [:reasons]).includes(:user).paginate(:page => params[:page], :per_page => 100)
    @sites = Site.where(:id => @flag_logs.map(&:post).map(&:site_id)).to_a
  end

  def by_post
    @individual_post = Post.find(params[:id])
    @flag_logs = @individual_post.flag_logs.order('created_at DESC, id DESC').includes(:post => [:feedbacks => [:user, :api_key]]).includes(:post => [:reasons]).includes(:user).paginate(:page => params[:page], :per_page => 100)
    @sites = Site.where(:id => @flag_logs.map(&:post).map(&:site_id)).to_a
    render :index
{'fraction_non_alphanumeric': 0.1767698177193726, 'fraction_numerical': 0.005086901229334464, 'mean_word_length': 5.082474226804123, 'pattern_counts': {'":': 0, '<': 5, '<?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': '114985', 'n_tokens_mistral': 839, 'n_tokens_neox': 772, 'n_words': 127}