<commit_before>module ApiCachedAttributes
  class AttributeHttpClient
    def initialize(attribute, client = nil)
      @attribute = attribute
      @client = client || @attribute.client
      @resource_name = @attribute.resource_name
    end

    def headers_only
      with_head_only_request do |client|
        @attribute.resource(client)
      end
      @client.last_response.headers
    end

    def with_head_only_request
      client_class = @client.singleton_class
      client_class.send(:alias_method, :orig_get, :get)
      client_class.send(:alias_method, :get, :head)
      yield @client
      client_class.send(:alias_method, :get, :orig_get)
    end
  end
end<commit_msg>add a simple GET method to http client<commit_after>module ApiCachedAttributes
  class AttributeHttpClient
    def initialize(attribute, client = nil)
      @attribute = attribute
      @client = client || @attribute.client
      @resource_name = @attribute.resource_name
    end

    def headers_only
      with_head_only_request do |client|
        @attribute.resource(client)
      end
      @client.last_response.headers
    end

    def get
      @attribute.resource(@client)
      @client.last_response
    end

    def with_head_only_request
      client_class = @client.singleton_class
      client_class.send(:alias_method, :orig_get, :get)
      client_class.send(:alias_method, :get, :head)
      yield @client
      client_class.send(:alias_method, :get, :orig_get)
    end
  end
end
{'fraction_non_alphanumeric': 0.08035111411208642, 'fraction_numerical': 0.0, 'mean_word_length': 3.1396648044692737, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4037091', 'n_tokens_mistral': 439, 'n_tokens_neox': 435, 'n_words': 97}