<commit_before>require 'rest-client'
require 'nokogiri'
require 'cat_api/image_search'
require 'cat_api/categories'

class CatAPI::Client
  attr_reader :categories

  BASE_URL = 'http://thecatapi.com/api/'

  def initialize(defaults={})
    @defaults = defaults
    response = get "#{ BASE_URL }categories/list"
    # @categories = CatAPI::Categories.new( Nokogiri::XML(response) )
    @categories = CatAPI::Categories.new( Nokogiri::XML(response) ).results
  end

  def get_images(options={})
    options = @defaults.merge(options)
    options.delete_if {|k,v| v.nil? || ( v.kind_of?(Array) && v.empty? ) }
    response = get "#{ BASE_URL }images/get?format=xml&#{ URI.encode_www_form options }"
    CatAPI::ImageSearch.new( Nokogiri::XML(response) ).results
  end

private

  def get(url)
    RestClient.get url
  end

end<commit_msg>remove comment out<commit_after>require 'rest-client'
require 'nokogiri'
require 'cat_api/image_search'
require 'cat_api/categories'

class CatAPI::Client
  attr_reader :categories

  BASE_URL = 'http://thecatapi.com/api/'

  def initialize(defaults={})
    @defaults = defaults
    response = get "#{ BASE_URL }categories/list"
    @categories = CatAPI::Categories.new( Nokogiri::XML(response) ).results
  end

  def get_images(options={})
    options = @defaults.merge(options)
    options.delete_if {|k,v| v.nil? || ( v.kind_of?(Array) && v.empty? ) }
    response = get "#{ BASE_URL }images/get?format=xml&#{ URI.encode_www_form options }"
    CatAPI::ImageSearch.new( Nokogiri::XML(response) ).results
  end

private

  def get(url)
    RestClient.get url
  end

end
{'fraction_non_alphanumeric': 0.1431238332296204, 'fraction_numerical': 0.0, 'mean_word_length': 4.395973154362416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '3475048', 'n_tokens_mistral': 563, 'n_tokens_neox': 551, 'n_words': 110}