<commit_before>module UserLeaveReportsHelper

  def mark_leave_users
    @mark_leave_users ||= begin
      mark_leave_groups = Setting.plugin_redmine_leaves['mark_leaves']
      if mark_leave_groups.present?
        User.active.joins(:groups).
          where("#{User.table_name_prefix}groups_users#{User.table_name_suffix}.id" => mark_leave_groups)
      else
        User.active.all
      end      
    end
  end
  
  def mark_own_leave_users
    @mark_own_leave_users ||= begin
      mark_own_leave_groups = Setting.plugin_redmine_leaves['mark_own_leave']
      User.active.joins(:groups).
      where("#{User.table_name_prefix}groups_users#{User.table_name_suffix}.id" => mark_own_leave_groups)
    end
  end
    
  def plugin_setting(setting_name)
    (Setting.plugin_redmine_leaves[setting_name] || '').split(',')
  end

  def eligible_for_leave_users
    group_ids = Setting.plugin_redmine_leaves['eligible_for_leave_groups']
    if group_ids.blank?
      User.active.all
    else
      User.active.joins(:groups).
      where("#{User.table_name_prefix}groups_users#{User.table_name_suffix}.id" => 
        group_ids).group("#{User.table_name}.id")
    end
  end

  def user_options(selected_users)
    options_from_collection_for_select(eligible_for_leave_users, :id, :name, selected_users)
  end
  <commit_msg>minor modifications added for handling white spaces<commit_after>module UserLeaveReportsHelper

  def mark_leave_users
    @mark_leave_users ||= begin
      mark_leave_groups = Setting.plugin_redmine_leaves['mark_leaves']
      if mark_leave_groups.present?
        User.active.joins(:groups).
          where("#{User.table_name_prefix}groups_users#{User.table_name_suffix}.id" => mark_leave_groups)
      else
        User.active.all
      end      
    end
  end
  
  def mark_own_leave_users
    @mark_own_leave_users ||= begin
      mark_own_leave_groups = Setting.plugin_redmine_leaves['mark_own_leave']
      User.active.joins(:groups).
      where("#{User.table_name_prefix}groups_users#{User.table_name_suffix}.id" => mark_own_leave_groups)
    end
  end
    
  def plugin_setting(setting_name)
    (Setting.plugin_redmine_leaves[setting_name] || '').split(',').delete_if { |index| index.blank? }
  end

  def eligible_for_leave_users
    group_ids = Setting.plugin_redmine_leaves['eligible_for_leave_groups']
    if group_ids.blank?
      User.active.all
    else
      User.active.joins(:groups).
      where("#{User.table_name_prefix}groups_users#{User.table_name_suffix}.id" => 
        group_ids).group("#{User.table_name}.id")
    end
  end

  def user_options(selected_users)
    options_from_collection_for_select(eligible_for_leave_users, :id, :name, selected_users)
  end
  
{'fraction_non_alphanumeric': 0.10291405385466618, 'fraction_numerical': 0.0, 'mean_word_length': 3.9219600725952812, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1872718', 'n_tokens_mistral': 912, 'n_tokens_neox': 898, 'n_words': 116}