<commit_before>require "google/api_client"

require "google_apis/core_ext"
require "google_apis/connection"
require "google_apis/api"
require "google_apis/version"

module GoogleApis

  class Error < StandardError; end

  def self.connect(options)
    @config = options.symbolize_keys
    @connection = Connection.new config
  end

  def self.config
    @config || {}
  end

  def self.connection
    @connection
  end

end

Faraday.default_adapter = :httpclient<commit_msg>Tackle gzip error for when using Faraday >= 0.9.2<commit_after>require "google/api_client"

require "google_apis/core_ext"
require "google_apis/connection"
require "google_apis/api"
require "google_apis/version"

module GoogleApis

  class Error < StandardError; end

  def self.connect(options)
    @config = options.symbolize_keys
    @connection = Connection.new config
  end

  def self.config
    @config || {}
  end

  def self.connection
    @connection
  end

end

# Use httpclient to avoid broken pipe errors with large uploads
Faraday.default_adapter = :httpclient

# Only add the following statement if using Faraday >= 0.9.2
# Override gzip middleware with no-op for httpclient
if (Faraday::VERSION.split(".").collect(&:to_i) <=> [0, 9, 2]) > -1
  Faraday::Response.register_middleware :gzip => Faraday::Response::Middleware
end
{'fraction_non_alphanumeric': 0.0958904109589041, 'fraction_numerical': 0.0076103500761035, 'mean_word_length': 4.411522633744856, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '612058', 'n_tokens_mistral': 430, 'n_tokens_neox': 407, 'n_words': 112}