<commit_before>#!/usr/bin/env ruby
require 'mkmf'

# This list is checked in reverse order, so this order allows mkmf on my Mac
# to find BDB installed via Homebrew (/usr/local) before system installs
%w[/usr / /usr/local /usr/local/db* /usr/local/BerkeleyDB*].each do |pdir|
	Dir[pdir].each do |dir|
		dir_config('db', "#{dir}/include", "#{dir}/lib")
	end
end

%w(db-5.1 db-5.0 db-4.9 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2).each do |ver|
	have_library ver, 'db_version', 'db.h'
end

def create_header
  if File.exist?("bdb_aux._c")
    message("Not writing bdb_aux._c (defines), already exists\n")
    return
  end
  
  message("Writing bdb_aux._c (defines), this takes a while\n")
  db_header = $CPPFLAGS.split.select { |f| f =~ /^-I/ }.map { |e| 
    f = File.join(e[2..-1], 'db.h')
    File.exists?(f) ? f : nil
  }.select { |e| e }.first
<commit_msg>Trivial whitespace cleanup<commit_after>#!/usr/bin/env ruby
require 'mkmf'

# This list is checked in reverse order, so this order allows mkmf on my Mac
# to find BDB installed via Homebrew (/usr/local) before system installs
%w[/usr / /usr/local /usr/local/db* /usr/local/BerkeleyDB*].each do |pdir|
	Dir[pdir].each do |dir|
		dir_config('db', "#{dir}/include", "#{dir}/lib")
	end
end

%w(db-5.1 db-5.0 db-4.9 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2).each do |ver|
	have_library ver, 'db_version', 'db.h'
end

def create_header
  if File.exist?("bdb_aux._c")
    message("Not writing bdb_aux._c (defines), already exists\n")
    return
  end
  
  message("Writing bdb_aux._c (defines), this takes a while\n")

  db_header = $CPPFLAGS.split.select { |f| f =~ /^-I/ }.map { |e| 
    f = File.join(e[2..-1], 'db.h')
    File.exists?(f) ? f : nil
  }.select { |e| e }.first

{'fraction_non_alphanumeric': 0.18327605956471935, 'fraction_numerical': 0.025200458190148912, 'mean_word_length': 3.199519230769231, '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': '3340207', 'n_tokens_mistral': 744, 'n_tokens_neox': 728, 'n_words': 194}