<commit_before>require 'jammed'
require 'webmock/rspec'

SAMPLE_RESPONSES_DIR = "sample_responses"

def serve_response(path, response_file_name)
  begin
    response_body = File.open(File.dirname(__FILE__) + "/#{SAMPLE_RESPONSES_DIR}/#{response_file_name.to_s}.json") {|io| io.read}
  rescue
    raise "Unable to find file [#{response_file_name}.json]"
  end
  
  stub_request(:get, path).to_return(:status => 200, :body => response_body, :headers => {:content_type => 'application/json'})
end<commit_msg>Formatting + legibility.<commit_after>require 'jammed'
require 'webmock/rspec'

SAMPLE_RESPONSES_DIR = "sample_responses"

def serve_response(path, file_name)
  begin
    response_body = File.binread(
                      File.dirname(__FILE__) +
                      "/#{SAMPLE_RESPONSES_DIR}/#{file_name.to_s}.json")
  rescue
    raise "Unable to read file [#{file_name}.json]"
  end
  
  stub_request(:get, path)
    .to_return(:status => 200, :body => response_body,
                               :headers => {:content_type => 'application/json'})
end
{'fraction_non_alphanumeric': 0.13452492944496708, 'fraction_numerical': 0.005644402634054563, 'mean_word_length': 3.7927927927927927, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '3263689', 'n_tokens_mistral': 368, 'n_tokens_neox': 361, 'n_words': 64}