<commit_before>require 'erb'

def template(filename)
  File.read(File.expand_path("../../templates/#{filename}", __FILE__))
end

def config(filename)
  File.read(File.expand_path("../../../config/#{filename}", __FILE__))
end

def erb_binding(file)
  ERB.new(template(file)).result(binding)
end

def upload_file(contents, upload_path)
  upload! StringIO.new(contents), upload_path
end

def put_sudo(contents, upload_path)
  filename = File.basename(upload_path)
  tmp_filename = "/tmp/#{filename}"
  put StringIO.new(contents), tmp_filename
  run :sudo, :mv, tmp_filename, upload_path
end<commit_msg>update erb_binding function name to erb_file<commit_after>require 'erb'

def template(filename)
  File.read(File.expand_path("../../templates/#{filename}", __FILE__))
end

def config(filename)
  File.read(File.expand_path("../../../config/#{filename}", __FILE__))
end

def erb_file(file)
  ERB.new(template(file)).result(binding)
end

def upload_file(contents, upload_path)
  upload! StringIO.new(contents), upload_path
end

def put_sudo(contents, upload_path)
  filename = File.basename(upload_path)
  tmp_filename = "/tmp/#{filename}"
  put StringIO.new(contents), tmp_filename
  run :sudo, :mv, tmp_filename, upload_path
end
{'fraction_non_alphanumeric': 0.1500815660685155, 'fraction_numerical': 0.0, 'mean_word_length': 5.668478260869565, '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': '3806852', 'n_tokens_mistral': 418, 'n_tokens_neox': 413, 'n_words': 82}