<commit_before>module Sorcery
  module Controller
    module Submodules
      module External
        module Providers
          # This module adds support for OAuth with facebook.com.
          # When included in the 'config.providers' option, it adds a new option, 'config.facebook'.
          # Via this new option you can configure Facebook specific settings like your app's key and secret.
          #
          #   config.facebook.key = <key>
          #   config.facebook.secret = <secret>
          #   ...
          #
          module Facebook
            def self.included(base)
              base.module_eval do
                class << self
                  attr_reader :facebook                           # access to facebook_client.
                  
                  def merge_facebook_defaults!
                    @defaults.merge!(:@facebook => FacebookClient)
                  end
                end
                merge_facebook_defaults!
                update!
              end
            end
          
            module FacebookClient
              class << self
                attr_accessor :key,
                              :secret,
                              :callback_url,
                              :site,
                              :user_info_path,
                              :scope,
                              :user_info_mapping,
                              :display
                            
                include Protocols::Oauth2
            
                def init
                  @site           = "https://graph.facebook.com"
                  @user_info_path = "/me"
                  @scope          = "email,offline_access"
                  @user_info_mapping = {}
                  @display        = "page"
                end
                
                def get_user_hash<commit_msg>support to get access token of external login, new external method access_token added<commit_after>module Sorcery
  module Controller
    module Submodules
      module External
        module Providers
          # This module adds support for OAuth with facebook.com.
          # When included in the 'config.providers' option, it adds a new option, 'config.facebook'.
          # Via this new option you can configure Facebook specific settings like your app's key and secret.
          #
          #   config.facebook.key = <key>
          #   config.facebook.secret = <secret>
          #   ...
          #
          module Facebook
            def self.included(base)
              base.module_eval do
                class << self
                  attr_reader :facebook                           # access to facebook_client.
                  
                  def merge_facebook_defaults!
                    @defaults.merge!(:@facebook => FacebookClient)
                  end
                end
                merge_facebook_defaults!
                update!
              end
            end
          
            module FacebookClient
              class << self
                attr_accessor :key,
                              :secret,
                              :callback_url,
                              :site,
                              :user_info_path,
                              :scope,
                              :user_info_mapping,
                              :display
                attr_reader   :access_token
                            
                include Protocols::Oauth2
            
                def init
                  @site           = "https://graph.facebook.com"
                  @user_info_path = "/me"
                  @scope          = "email,offline_access"
                  @user_info_mapping = {}
                  @display        = "page"
                end
                
                def get_user_hash
{'fraction_non_alphanumeric': 0.05451713395638629, 'fraction_numerical': 0.0005192107995846313, 'mean_word_length': 0.900838677849038, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6646958', 'n_tokens_mistral': 841, 'n_tokens_neox': 789, 'n_words': 217}