<commit_before>class Kaui::BundlesController < Kaui::EngineController

  def index
    if params[:bundle_id].present?
      redirect_to kaui_engine.bundle_path(params[:bundle_id])
    end
  end

  def show
    key = params[:id]
    if key.present?
      begin
        @bundle = Kaui::KillbillHelper::get_bundle_by_key(key, params[:account_id], options_for_klient)

        if @bundle.present?
          @account = Kaui::KillbillHelper::get_account_by_bundle_id(@bundle.bundle_id, options_for_klient)
          @subscriptions = Kaui::KillbillHelper::get_subscriptions_for_bundle(@bundle.bundle_id, options_for_klient)
        else
          flash.now[:error] = "Bundle #{key} not found"
          render :action => :index
        end
      rescue => e
        flash.now[:error] = "Error while retrieving bundle information for #{key}: #{as_string(e)}"
      end
    else
      flash.now[:error] = "No id given"<commit_msg>controllers: optimize bundles#show<commit_after>class Kaui::BundlesController < Kaui::EngineController

  def index
    if params[:bundle_id].present?
      redirect_to kaui_engine.bundle_path(params[:bundle_id])
    end
  end

  def show
    key = params[:id]
    if key.present?
      begin
        @bundle = Kaui::KillbillHelper::get_bundle_by_key(key, params[:account_id], options_for_klient)

        if @bundle.present?
          @account = Kaui::KillbillHelper::get_account(@bundle.account_id, false, false, options_for_klient)
          @subscriptions = Kaui::KillbillHelper::get_subscriptions_for_bundle(@bundle.bundle_id, options_for_klient)
        else
          flash.now[:error] = "Bundle #{key} not found"
          render :action => :index
        end
      rescue => e
        flash.now[:error] = "Error while retrieving bundle information for #{key}: #{as_string(e)}"
      end
    else
      flash.now[:error] = "No id given"
{'fraction_non_alphanumeric': 0.11152815013404825, 'fraction_numerical': 0.0, 'mean_word_length': 3.3094688221709005, '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': '6975210', 'n_tokens_mistral': 601, 'n_tokens_neox': 580, 'n_words': 117}