<commit_before>class NotificationsController < ApplicationController
  before_filter :load_notification, only: [:destroy]
  load_and_authorize_reagent
  skip_authorize_reagent :only => [:create, :routing_error]

  def index
    @servers = ENV['SERVERS'].split(",")

    collection = Notification
    if params[:agent_id]
      collection = collection.includes(:agent)
                   .where("agents.name = ?", params[:agent_id])
                   .references(:agent)
      @agent = Agent.where(name: params[:agent_id]).first
    end

    if params[:hostname]
      collection = collection.where(:hostname => params[:hostname])
      @hostname = params[:hostname]
    end

    if params[:class_name]
      collection = collection.where(:class_name => params[:class_name])
      @class_name = params[:class_name]
    end

    if params[:level]
      level = Notification::LEVELS.index(params[:level].upcase) || 0<commit_msg>fixed broken command name<commit_after>class NotificationsController < ApplicationController
  before_filter :load_notification, only: [:destroy]
  load_and_authorize_resource
  skip_authorize_resource :only => [:create, :routing_error]

  def index
    @servers = ENV['SERVERS'].split(",")

    collection = Notification
    if params[:agent_id]
      collection = collection.includes(:agent)
                   .where("agents.name = ?", params[:agent_id])
                   .references(:agent)
      @agent = Agent.where(name: params[:agent_id]).first
    end

    if params[:hostname]
      collection = collection.where(:hostname => params[:hostname])
      @hostname = params[:hostname]
    end

    if params[:class_name]
      collection = collection.where(:class_name => params[:class_name])
      @class_name = params[:class_name]
    end

    if params[:level]
      level = Notification::LEVELS.index(params[:level].upcase) || 0
{'fraction_non_alphanumeric': 0.12433011789924973, 'fraction_numerical': 0.0010718113612004287, 'mean_word_length': 3.5096618357487923, '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': '6976062', 'n_tokens_mistral': 532, 'n_tokens_neox': 525, 'n_words': 102}