<commit_before>class ApplicationController < ActionController::Base
  include Pundit

  protect_from_forgery :with => :exception
  ensure_security_headers

  prepend_view_path TemplateStorage.resolver

  before_action :set_locale

  # This is a hook for Devise so that it knows to include the required :locale
  # parameter in generated login page URLs.
  def self.default_url_options
    { :locale => I18n.locale }
  end

  private

  # Overridden in other controllers to indicate whether the controller is
  # scoped to a specific catalog.
  def catalog_scoped?
    false
  end
  helper_method :catalog_scoped?

  # Overridden in other controllers to indicate whether the controller is
  # scoped to a specific user.
  def user_scoped?
    false
  end
  helper_method :user_scoped?

  # Overridden in other controllers to indicate whether the controller is
  # scoped to favorites.
  def favorites_scoped?
    false
  end
  helper_method :favorites_scoped?

  def set_locale
    if I18n.locale_available?(params[:locale])
      I18n.locale = params[:locale]
    else
      I18n.locale = I18n.default_locale
    end
  end

  def current_user
    @current_user ||= (super || Guest.new)
  end

  # If we've store an explicit redirect path, use it. This allows us to
  # maintain the current page when logging in/out.
  def after_devise_action_for(resource)
    stored_location_for(resource) || root_url
  end
  alias_method :after_sign_in_path_for, :after_devise_action_for
  alias_method :after_sign_out_path_for, :after_devise_action_for
  alias_method :after_sign_up_path_for, :after_devise_action_for
end
<commit_msg>Deleted some comments in application_controller<commit_after>class ApplicationController < ActionController::Base
  include Pundit

  protect_from_forgery :with => :exception
  ensure_security_headers

  prepend_view_path TemplateStorage.resolver

  before_action :set_locale

  # This is a hook for Devise so that it knows to include the required :locale
  # parameter in generated login page URLs.
  def self.default_url_options
    { :locale => I18n.locale }
  end

  private

  # Overridden in other controllers to indicate whether the controller is
  # scoped to a specific catalog.
  def catalog_scoped?
    false
  end
  helper_method :catalog_scoped?

  def user_scoped?
    false
  end
  helper_method :user_scoped?

  def favorites_scoped?
    false
  end
  helper_method :favorites_scoped?

  def set_locale
    if I18n.locale_available?(params[:locale])
      I18n.locale = params[:locale]
    else
      I18n.locale = I18n.default_locale
    end
  end

  def current_user
    @current_user ||= (super || Guest.new)
  end

  # If we've store an explicit redirect path, use it. This allows us to
  # maintain the current page when logging in/out.
  def after_devise_action_for(resource)
    stored_location_for(resource) || root_url
  end
  alias_method :after_sign_in_path_for, :after_devise_action_for
  alias_method :after_sign_out_path_for, :after_devise_action_for
  alias_method :after_sign_up_path_for, :after_devise_action_for
end

{'fraction_non_alphanumeric': 0.05472312703583062, 'fraction_numerical': 0.006514657980456026, 'mean_word_length': 4.10981697171381, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '2637337', 'n_tokens_mistral': 989, 'n_tokens_neox': 951, 'n_words': 282}