<commit_before>require "stormpath-sdk"

module Stormpath
  module Rails
    class Client
      class << self
        attr_accessor :connection, :root_directory, :root_application
      end

      def self.authenticate_account(username, password)
        auth_result = application.authenticate_account(
          Stormpath::Authentication::UsernamePasswordRequest.new(username, password)
        )
        auth_result.account
      end

      def self.send_password_reset_email(email)
        application.send_password_reset_email email
      end

      def self.verify_password_reset_token(token)
        application.verify_password_reset_token token
      end

      def self.verify_account_email(token)
        self.client.accounts.verify_email_token token
      end<commit_msg>Check for required config var<commit_after>require "stormpath-sdk"

module Stormpath
  module Rails
    class ConfigurationError < StandardError; end

    if ENV['STORMPATH_URL'].nil? && ENV['STORMPATH_APPLICATION_URL'].nil?
      raise ConfigurationError, 'Either STORMPATH_URL or STORMPATH_APPLICATION_URL must be set'
    end

    class Client
      class << self
        attr_accessor :connection, :root_directory, :root_application
      end

      def self.authenticate_account(username, password)
        auth_result = application.authenticate_account(
          Stormpath::Authentication::UsernamePasswordRequest.new(username, password)
        )
        auth_result.account
      end

      def self.send_password_reset_email(email)
        application.send_password_reset_email email
      end

      def self.verify_password_reset_token(token)
        application.verify_password_reset_token token
      end

      def self.verify_account_email(token)
        self.client.accounts.verify_email_token token
      end
{'fraction_non_alphanumeric': 0.0592469545957918, 'fraction_numerical': 0.0, 'mean_word_length': 3.22196261682243, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 3, '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': '5975775', 'n_tokens_mistral': 500, 'n_tokens_neox': 482, 'n_words': 98}