<commit_before>require 'webmock'
require 'addressable/uri'
require 'json'
require 'yaml'

def fixture(path)
  File.join(File.dirname(__FILE__), 'fixtures', path)
end

def yaml_load(file)
  YAML.load_file(fixture(file))
end

include WebMock::API

class WebMocks
  def self.load_dir(dir)<commit_msg>Forcing tests to use Psych YAML parser (newer parser) in order to parse some of our more complex YAML fixtures.<commit_after>require 'webmock'
require 'addressable/uri'
require 'json'
require 'yaml'

# Force YAML to use newer parsing engine.
YAML::ENGINE.yamler = 'psych'

def fixture(path)
  File.join(File.dirname(__FILE__), 'fixtures', path)
end

def yaml_load(file)
  YAML.load_file(fixture(file))
end

include WebMock::API

class WebMocks
  def self.load_dir(dir)
{'fraction_non_alphanumeric': 0.1084967320261438, 'fraction_numerical': 0.0, 'mean_word_length': 5.900900900900901, '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': '575659', 'n_tokens_mistral': 280, 'n_tokens_neox': 268, 'n_words': 75}