<commit_before># encoding: utf-8
require 'rest-client'
require 'contact-data/exception'

module ContactData
  class Fetcher
<<<<<<< HEAD
    attr_reader :http_method, :api_method, :options

    URL = ENV['XENDATA_URL'] || 'http://public.xenapto.com'
    API = 'api/v2'

    LOGLEVEL = Logger::WARN

    class << self
      [:get, :post].each do |http_method|
        define_method(http_method) do |api_method, options = {}|
          new(http_method, api_method, options).parsed_json
        end
      end
    end

    def parsed_json
      logger.info { "Parsing #{json.length} characters of JSON" }
      JSON.parse(json, symbolize_names: true, allow_nan: true)
    end

    def url
      return @url if @url

      if api_method.is_a?(String)
        @url = "#{url_base}/#{api_method}"
      else
        @url = "#{api_base}/#{method_base}#{api_method}"
      end
<commit_msg>Fix conflict<commit_after># encoding: utf-8
require 'rest-client'
require 'contact-data/exception'

module ContactData
  class Fetcher
    attr_reader :http_method, :api_method, :options

    URL = ENV['XENDATA_URL'] || 'http://public.xenapto.com'
    API = 'api/v2'

    LOGLEVEL = Logger::WARN

    class << self
      [:get, :post].each do |http_method|
        define_method(http_method) do |api_method, options = {}|
          new(http_method, api_method, options).parsed_json
        end
      end
    end

    def parsed_json
      logger.info { "Parsing #{json.length} characters of JSON" }
      JSON.parse(json, symbolize_names: true, allow_nan: true)
    end

    def url
      return @url if @url

      if api_method.is_a?(String)
        @url = "#{url_base}/#{api_method}"
      else
        @url = "#{api_base}/#{method_base}#{api_method}"
      end

{'fraction_non_alphanumeric': 0.1290137614678899, 'fraction_numerical': 0.0022935779816513763, 'mean_word_length': 2.777056277056277, 'pattern_counts': {'":': 0, '<': 14, '<?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': '1654293', 'n_tokens_mistral': 594, 'n_tokens_neox': 589, 'n_words': 134}