<commit_before>class UsersController < ApplicationController
  before_filter :authenticate_user!
  before_filter :check_system_admin, :only => [:new, :create, :edit, :update, :destroy]

  # Retrieves filtered list of users.
  def filtered
    @search = params[:search]
    @relation = params[:relation]
    render :partial => 'user_select_filter'
  end
  
  def index
    current_user.update_attribute :users_per_page, params[:users_per_page].to_i if params[:users_per_page].to_i >= 10 and params[:users_per_page].to_i <= 200
    @order = params[:order].blank? ? 'users.current_sign_in_at DESC' : params[:order]
    users_scope = User.current
    @search_terms = (params[:search] || params[:q]).to_s.gsub(/[^0-9a-zA-Z]/, ' ').split(' ')
    @search_terms.each{|search_term| users_scope = users_scope.search(search_term) }
    users_scope = users_scope.order(@order)
    @users = users_scope.page(params[:page]).per(current_user.users_per_page)
    respond_to do |format|
      format.html
      format.js
      format.json { render :json => params[:q].to_s.split(',').collect{|u| {:name => u.strip.titleize, :id => u.strip.titleize}} + @users.collect{|u| {:name => u.name, :id => u.name}}}
    end<commit_msg>If users put "Me" as writing group nomination it puts their full name in the drop down.<commit_after>class UsersController < ApplicationController
  before_filter :authenticate_user!
  before_filter :check_system_admin, :only => [:new, :create, :edit, :update, :destroy]

  # Retrieves filtered list of users.
  def filtered
    @search = params[:search]
    @relation = params[:relation]
    render :partial => 'user_select_filter'
  end
  
  def index
    current_user.update_attribute :users_per_page, params[:users_per_page].to_i if params[:users_per_page].to_i >= 10 and params[:users_per_page].to_i <= 200
    @order = params[:order].blank? ? 'users.current_sign_in_at DESC' : params[:order]
    users_scope = User.current
    @search_terms = (params[:search] || params[:q]).to_s.gsub(/[^0-9a-zA-Z]/, ' ').split(' ')
    @search_terms.each{|search_term| users_scope = users_scope.search(search_term) }
    users_scope = users_scope.order(@order)
    @users = users_scope.page(params[:page]).per(current_user.users_per_page)
    respond_to do |format|
      format.html
      format.js
      format.json { render :json => params[:q].to_s.split(',').collect{|u| (u.strip.downcase == 'me') ? {:name => current_user.name, :id => current_user.name} : {:name => u.strip.titleize, :id => u.strip.titleize}} + @users.collect{|u| {:name => u.name, :id => u.name}}}
    end
{'fraction_non_alphanumeric': 0.15671062839410396, 'fraction_numerical': 0.005430566330488751, 'mean_word_length': 4.475583864118896, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 21, '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': '3379867', 'n_tokens_mistral': 894, 'n_tokens_neox': 859, 'n_words': 173}