<commit_before>class MatricesController < ApplicationController

  ### Resources methods ########################################################

  def index
    @filterrific = initialize_filterrific(
      Matrix,
      params[:filterrific],
      select_options: {
        sorted_by: Matrix.options_for_sorted_by,
        positive_definite_options: ['Yes', 'No'],
      }
    ) or return
    
    @matrices = @filterrific.find.page(params[:page])

    @per_page = helpers.per_page(params, session)
    
    @matrices = @matrices.paginate(page: params[:page], per_page: @per_page)

    respond_to do |format|
      format.html
      format.js
    end
  end

  def show
    # Get matrix info from the params
    id, group, name = params.values_at(:id, :group, :name)

    # Show the details page for a matrix
    @matrix = Matrix.find_by(id: id) || Matrix.find_by(name: name, group: group)
    if !@matrix
      render :not_found
    end
  end

  def new
    # Get a list of kinds currently in the collection
    @kinds = helpers.kind_list

    # Add an option for an "Other" kind if the submission is really different
    @kinds.push("Other")
  end

  def submit
    # Verify the reCaptcha
    if verify_recaptcha
      flash[:notice] = "Matrix submitted successfully!"
      redirect_to :index
    else
      flash[:notice] = "Please satisfy the reCaptcha."
      redirect_to :new
    end
  end

end<commit_msg>Minor text change for reCaptcha verification<commit_after>class MatricesController < ApplicationController

  ### Resources methods ########################################################

  def index
    @filterrific = initialize_filterrific(
      Matrix,
      params[:filterrific],
      select_options: {
        sorted_by: Matrix.options_for_sorted_by,
        positive_definite_options: ['Yes', 'No'],
      }
    ) or return
    
    @matrices = @filterrific.find.page(params[:page])

    @per_page = helpers.per_page(params, session)
    
    @matrices = @matrices.paginate(page: params[:page], per_page: @per_page)

    respond_to do |format|
      format.html
      format.js
    end
  end

  def show
    # Get matrix info from the params
    id, group, name = params.values_at(:id, :group, :name)

    # Show the details page for a matrix
    @matrix = Matrix.find_by(id: id) || Matrix.find_by(name: name, group: group)
    if !@matrix
      render :not_found
    end
  end

  def new
    # Get a list of kinds currently in the collection
    @kinds = helpers.kind_list

    # Add an option for an "Other" kind if the submission is really different
    @kinds.push("Other")
  end

  def submit
    # Verify the reCaptcha
    if verify_recaptcha
      flash[:notice] = "Matrix submitted successfully!"
      redirect_to :index
    else
      flash[:notice] = "Please verify that you are not a robot."
      redirect_to :new
    end
  end

end
{'fraction_non_alphanumeric': 0.12547926106657373, 'fraction_numerical': 0.0, 'mean_word_length': 2.9423076923076925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '5985965', 'n_tokens_mistral': 867, 'n_tokens_neox': 846, 'n_words': 252}