<commit_before>class ApplicationController < ActionController::Base
  protect_from_forgery
  before_filter :set_locale
  def set_locale
    if lang = request.env['HTTP_ACCEPT_LANGUAGE']
      lang = lang[/^[a-z]{2}/]
    end
    I18n.locale = params[:locale] || lang || I18n.default_locale
  end
  # app/controllers/application_controller.rb
  def default_url_options(options={})
    logger.debug "default_url_options is passed options: #{options.inspect}\n"
    { locale: I18n.locale }
  end

  unless Rails.application.config.consider_all_requests_local
    rescue_from Net::HTTP::Persistent::Error, :with => :render_db_error
  end
  def render_db_error(exception)
    render :template => "/errors/noBD.html", :layout => "empty", :status => 500 and return
  end
end
<commit_msg>add mysql error in db error list<commit_after>class ApplicationController < ActionController::Base
  protect_from_forgery
  before_filter :set_locale
  def set_locale
    if lang = request.env['HTTP_ACCEPT_LANGUAGE']
      lang = lang[/^[a-z]{2}/]
    end
    I18n.locale = params[:locale] || lang || I18n.default_locale
  end
  # app/controllers/application_controller.rb
  def default_url_options(options={})
    logger.debug "default_url_options is passed options: #{options.inspect}\n"
    { locale: I18n.locale }
  end

  unless Rails.application.config.consider_all_requests_local
    rescue_from Net::HTTP::Persistent::Error, :with => :render_db_error
    rescue_from Mysql2::Error, :with => :render_db_error
  end
  def render_db_error(exception)
    render :template => "/errors/noBD.html", :layout => "empty", :status => 500 and return
  end
end

{'fraction_non_alphanumeric': 0.11430317848410758, 'fraction_numerical': 0.012836185819070905, 'mean_word_length': 4.530405405405405, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '5708722', 'n_tokens_mistral': 542, 'n_tokens_neox': 521, 'n_words': 112}