<commit_before>module Aptible
  module Rails
    module ViewHelpers
      def unix_to_formatted_date(unix_timestamp, format = '%m/%d/%Y')
        Time.at(unix_timestamp).to_datetime.strftime(format)
      end

      def gravatar_url(email, size = 80)
        digest = Digest::MD5.hexdigest(email.downcase)
        "https://secure.gravatar.com/avatar/#{digest}?s=#{size}"
      end

      def controller?(*controller)
        controller.include?(params[:controller])
      end

      def action?(*action)
        action.include?(params[:action])
      end

      def verification_code_reset_url
        callback = "#{dashboard_url}/callback?type=verification_code_reset"
        auth_url(
          '/reset',
          type: 'verification_code',
          redirect_uri: callback
        )
      end

      def return_to_context_url(local_assigns)
        if controller?('organizations')
          root_url
        elsif local_assigns[:compliance_page]
          compliance_url
        else
          'current_url'
        end
      end
    end
  end
end<commit_msg>added apps and dbs<commit_after>module Aptible
  module Rails
    module ViewHelpers
      def unix_to_formatted_date(unix_timestamp, format = '%m/%d/%Y')
        Time.at(unix_timestamp).to_datetime.strftime(format)
      end

      def gravatar_url(email, size = 80)
        digest = Digest::MD5.hexdigest(email.downcase)
        "https://secure.gravatar.com/avatar/#{digest}?s=#{size}"
      end

      def controller?(*controller)
        controller.include?(params[:controller])
      end

      def action?(*action)
        action.include?(params[:action])
      end

      def verification_code_reset_url
        callback = "#{dashboard_url}/callback?type=verification_code_reset"
        auth_url(
          '/reset',
          type: 'verification_code',
          redirect_uri: callback
        )
      end

      def return_to_context_url(local_assigns)
        if controller?('organizations')
          root_url
        elsif controller?('apps')
          apps_url
        elsif controller?('databases')
          databases_url
        elsif local_assigns[:compliance_page]
          compliance_url
        else
          'current_url'
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.09604268563806136, 'fraction_numerical': 0.0026678523788350376, 'mean_word_length': 2.2798833819241984, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '7464792', 'n_tokens_mistral': 679, 'n_tokens_neox': 658, 'n_words': 116}