<commit_before>require 'net/http'
require 'net/https'
require 'uri'
require 'json'

def rest_request(endpoint, href, options)
  uri = URI.join(endpoint, href)
  puts "[GET] #{uri}" if options[:verbose]
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  request = Net::HTTP::Get.new(uri.request_uri)
  request.basic_auth(options[:user], options[:password])
  if options[:prettify]
    JSON.parse(http.request(request).body)
  else
    JSON.pretty_generate(JSON.parse(http.request(request).body))
  end
end<commit_msg>Fix conditions in if statement for prettify option.<commit_after>require 'net/http'
require 'net/https'
require 'uri'
require 'json'

def rest_request(endpoint, href, options)
  uri = URI.join(endpoint, href)
  puts "[GET] #{uri}" if options[:verbose]
  http = Net::HTTP.new(uri.host, uri.port)
  http.use_ssl = true
  request = Net::HTTP::Get.new(uri.request_uri)
  request.basic_auth(options[:user], options[:password])
  if options[:prettify]
    JSON.pretty_generate(JSON.parse(http.request(request).body))
  else
    JSON.parse(http.request(request).body)
  end
end
{'fraction_non_alphanumeric': 0.14972776769509982, 'fraction_numerical': 0.0, 'mean_word_length': 5.3028571428571425, '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': '4360974', 'n_tokens_mistral': 376, 'n_tokens_neox': 375, 'n_words': 78}