<commit_before>module GoogleGeocoding    
  class Geocoder
    def self.query(address, options = {})
      self.new(options).query(address)
    end
    
    # Creates a new geocoder instance.
    # @see Geocoder#geocode
    def initialize(options = {})
      @options = options
      @sess = Patron::Session.new
      @sess.timeout = options[:timeout] || 10
      @sess.base_url = "http://maps.google.com/maps/geo"
      @sess.headers['User-Agent'] = options[:user_agent]
    end

    # Performs a geocoding request against google for the given address.
    #
    # @param [String, #to_s]
    # @return [Response]
    def query(address)
      params = "?q=#{URI.encode(address.to_s)}"
      params << "&key=#{@options[:api_key]}" if @options[:api_key]
      resp = @sess.get(params)
  
      if (200...300).include?(resp.status)
        Response.new(resp.body)
      else
        raise GeocodeError.new(address, resp)
      end
    end
  end
end<commit_msg>Fix errors<commit_after>module GoogleGeocoding    
  class Geocoder
    def self.query(address, options = {})
      self.new(options).query(address)
    end
    
    # Creates a new geocoder instance.
    # @see Geocoder#geocode
    def initialize(options = {})
      @options = options
      @sess = Patron::Session.new
      @sess.timeout = options[:timeout] || 10
      @sess.base_url = "http://maps.google.com/maps/geo"
      @sess.headers['User-Agent'] = options[:user_agent]
    end

    # Performs a geocoding request against google for the given address.
    #
    # @param [String, #to_s]
    # @return [Response]
    def query(address)
      params = "?q=#{URI.encode(address.to_s)}"
      params << "&key=#{@options[:api_key]}" if @options[:api_key]
      resp = @sess.get(params)
  
      if (200...300).include?(resp.status)
        Response.new(resp.body)
      else
        raise Errors::HttpError.new(address, resp)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.13778705636743216, 'fraction_numerical': 0.008350730688935281, 'mean_word_length': 2.616981132075472, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2954093', 'n_tokens_mistral': 649, 'n_tokens_neox': 640, 'n_words': 132}