<commit_before>module Spree
  class Admin::AnalyticsController < Admin::BaseController

    def register
      redirect_if_registered and return

      begin
        store = Spree::Dash::Jirafe.register(store_hash)
        Spree::Dash::Config.app_id = store[:app_id]
        Spree::Dash::Config.app_token = store[:app_token]
        Spree::Dash::Config.site_id = store[:site_id]
        Spree::Dash::Config.token = store[:site_token]
        redirect_to admin_path
      rescue Spree::Dash::JirafeException => e
        flash[:error] = e.message
        redirect_to admin_path
      end<commit_msg>Revert "[dash] Redirect to admin path if JirafeException is thrown"<commit_after>module Spree
  class Admin::AnalyticsController < Admin::BaseController

    def register
      redirect_if_registered and return

      begin
        store = Spree::Dash::Jirafe.register(store_hash)
        Spree::Dash::Config.app_id = store[:app_id]
        Spree::Dash::Config.app_token = store[:app_token]
        Spree::Dash::Config.site_id = store[:site_id]
        Spree::Dash::Config.token = store[:site_token]
        redirect_to admin_path
      rescue Spree::Dash::JirafeException => e
        flash[:error] = e.message
        redirect_to root_path
      end
{'fraction_non_alphanumeric': 0.10408326661329063, 'fraction_numerical': 0.0, 'mean_word_length': 3.310344827586207, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5213819', 'n_tokens_mistral': 389, 'n_tokens_neox': 384, 'n_words': 70}