<commit_before>require 'omniauth-oauth2'
require 'base64'

module OmniAuth
  module Strategies
    class Clever < OmniAuth::Strategies::OAuth2
      option :name, "clever"

      option :client_options, {
        :site          => 'https://api.getclever.com',
        :authorize_url => 'https://account.getclever.com/oauth/authorize',
        :token_url     => 'https://api.getclever.com/oauth/token'
      }

      def authorize_params
        super.tap do |params|
          params[:scope] = 'read_only'
          params[:clever_landing] = options.client_options.fetch(:clever_landing, 'admin')
        end
      end

      def token_params
        username_password = options.client_secret + ":"
        super.tap do |params|
          params[:headers] = {'Authorization' => "Basic #{Base64.encode64(username_password)}"}
        end
      end



      uid{ raw_info['data']['id'] }<commit_msg>Changes #fetch to an or for the purpose of setting the default for the clever_landing param to admin<commit_after>require 'omniauth-oauth2'
require 'base64'

module OmniAuth
  module Strategies
    class Clever < OmniAuth::Strategies::OAuth2
      option :name, "clever"

      option :client_options, {
        :site          => 'https://api.getclever.com',
        :authorize_url => 'https://account.getclever.com/oauth/authorize',
        :token_url     => 'https://api.getclever.com/oauth/token'
      }

      def authorize_params
        super.tap do |params|
          params[:scope] = 'read_only'
          params[:clever_landing] = options.client_options.clever_landing || 'admin'
        end
      end

      def token_params
        username_password = options.client_secret + ":"
        super.tap do |params|
          params[:headers] = {'Authorization' => "Basic #{Base64.encode64(username_password)}"}
        end
      end



      uid{ raw_info['data']['id'] }
{'fraction_non_alphanumeric': 0.12213333333333333, 'fraction_numerical': 0.008533333333333334, 'mean_word_length': 2.5733333333333333, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 6, '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': '5375041', 'n_tokens_mistral': 592, 'n_tokens_neox': 567, 'n_words': 115}