<commit_before>local utilities = {}

local bit32 = require("bit32-compat")

math.epsilon = 1E-12

function utilities.required(t, name, context)
  if not t[name] then utilities.error(context.." needs a "..name.." parameter") end
  return t[name]<commit_msg>Port boolean option parser from CaSILE<commit_after>local utilities = {}

local bit32 = require("bit32-compat")

math.epsilon = 1E-12

function utilities.required(t, name, context)
  if not t[name] then utilities.error(context.." needs a "..name.." parameter") end
  return t[name]
end

function utilities.boolean (value, default)
  if value == "false" then return false end
  if value == false then return false end
  if value == "true" then return true end
  if value == true then return true end
  return default
{'fraction_non_alphanumeric': 0.11673151750972763, 'fraction_numerical': 0.018158236057068743, 'mean_word_length': 4.324137931034483, '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': '4395420', 'n_tokens_mistral': 245, 'n_tokens_neox': 225, 'n_words': 85}