<commit_before>require 'net/http'

require 'resourceful/version'
require 'resourceful/options_interpreter'
require 'resourceful/authentication_manager'
require 'resourceful/cache_manager'
require 'resourceful/resource'
require 'resourceful/stubbed_resource_proxy'

module Resourceful
  # This is an imitation Logger used when no real logger is
  # registered.  This allows most of the code to assume that there
  # is always a logger available, which significantly improved the
  # readability of the logging related code.
  class BitBucketLogger
    def warn(*args); end
    def info(*args); end
    def debug(*args); end
  end

  # This is the simplest logger. It just writes everything to STDOUT.
  class StdOutLogger
    def warn(*args); puts args; end
    def info(*args); puts args; end
    def debug(*args); puts args; end
  end
  
  # This class provides a simple interface to the functionality
  # provided by the Resourceful library.  Conceptually this object
  # acts a collection of all the resources available via HTTP.
  class HttpAccessor
    RESOURCEFUL_USER_AGENT_TOKEN = "Resourceful/#{RESOURCEFUL_VERSION}(Ruby/#{RUBY_VERSION})"
    
    # A logger object to which messages about the activities of this
    # object will be written.  This should be an object that responds
    # to +#info(message)+ and +#debug(message)+.  
    #
    # Errors will not be logged.  Instead an exception will be raised
    # and the application code should log it if appropriate.
    attr_accessor :logger
    
    attr_reader :auth_manager, :cache_manager
    
    attr_reader :user_agent_tokens  
    
    INIT_OPTIONS = OptionsInterpreter.new do 
      option(:logger, :default => Resourceful::BitBucketLogger.new)
      option(:user_agent, :default => []) {|ua| [ua].flatten}
      option(:cache_manager, :default => NullCacheManager.new)
    end
    
    # Initializes a new HttpAccessor.  Valid options:
    #
    #  +:logger+:: A Logger object that the new HTTP accessor should
    #    send log messages
    #
    #  +:user_agent+:: One or more additional user agent tokens to<commit_msg>Make the cache manager settable after init<commit_after>require 'net/http'

require 'resourceful/version'
require 'resourceful/options_interpreter'
require 'resourceful/authentication_manager'
require 'resourceful/cache_manager'
require 'resourceful/resource'
require 'resourceful/stubbed_resource_proxy'

module Resourceful
  # This is an imitation Logger used when no real logger is
  # registered.  This allows most of the code to assume that there
  # is always a logger available, which significantly improved the
  # readability of the logging related code.
  class BitBucketLogger
    def warn(*args); end
    def info(*args); end
    def debug(*args); end
  end

  # This is the simplest logger. It just writes everything to STDOUT.
  class StdOutLogger
    def warn(*args); puts args; end
    def info(*args); puts args; end
    def debug(*args); puts args; end
  end
  
  # This class provides a simple interface to the functionality
  # provided by the Resourceful library.  Conceptually this object
  # acts a collection of all the resources available via HTTP.
  class HttpAccessor
    RESOURCEFUL_USER_AGENT_TOKEN = "Resourceful/#{RESOURCEFUL_VERSION}(Ruby/#{RUBY_VERSION})"
    
    # A logger object to which messages about the activities of this
    # object will be written.  This should be an object that responds
    # to +#info(message)+ and +#debug(message)+.  
    #
    # Errors will not be logged.  Instead an exception will be raised
    # and the application code should log it if appropriate.
    attr_accessor :logger, :cache_manager
    
    attr_reader :auth_manager
    
    attr_reader :user_agent_tokens  
    
    INIT_OPTIONS = OptionsInterpreter.new do 
      option(:logger, :default => Resourceful::BitBucketLogger.new)
      option(:user_agent, :default => []) {|ua| [ua].flatten}
      option(:cache_manager, :default => NullCacheManager.new)
    end
    
    # Initializes a new HttpAccessor.  Valid options:
    #
    #  +:logger+:: A Logger object that the new HTTP accessor should
    #    send log messages
    #
    #  +:user_agent+:: One or more additional user agent tokens to
{'fraction_non_alphanumeric': 0.07486377635631367, 'fraction_numerical': 0.0, 'mean_word_length': 3.6041439476553983, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3929975', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1171, 'n_words': 445}