<commit_before>class ApplicationController < ActionController::Base
  self.responder = PutPatchResponder
  protect_from_forgery with: :exception
  before_filter :authenticate_user!

  def index
  end

  protected

  def numeric_id?(id); /^\d+$/.match(id).present?; end

  def authenticate_admin!
    authenticate_user! if current_user.nil?
    unless current_user.admin?
      Rails.logger.warn("Unauthorized attempt by #{current_user.username} to #{params[:controller]}##{params[:action]}")
      msg =I18n.t('errors.admin.not_authorized')
      respond_to do |format|
        format.html { render text: msg, status: :forbidden}
        format.json {render json: msg, status: :forbidden}
      end
    end
  end
end<commit_msg>Remove old numeric_id?-checker method<commit_after>class ApplicationController < ActionController::Base
  self.responder = PutPatchResponder
  protect_from_forgery with: :exception
  before_filter :authenticate_user!

  def index
  end

  protected
  def authenticate_admin!
    authenticate_user! if current_user.nil?
    unless current_user.admin?
      Rails.logger.warn("Unauthorized attempt by #{current_user.username} to #{params[:controller]}##{params[:action]}")
      msg =I18n.t('errors.admin.not_authorized')
      respond_to do |format|
        format.html { render text: msg, status: :forbidden}
        format.json {render json: msg, status: :forbidden}
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10400562192550948, 'fraction_numerical': 0.0028109627547434997, 'mean_word_length': 4.085714285714285, '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': '4613928', 'n_tokens_mistral': 442, 'n_tokens_neox': 428, 'n_words': 102}