<commit_before>#encoding: utf-8
require 'configuration'
require 'model/program'
require 'erb'
require 'fileutils'
require 'renderable'

class Renderer
  include FileUtils
  include Renderable

  def render(template, locals={})
  end

  def write(content, file_name='sessions.html', output_dir=self.output_dir)
    f = File.join(output_dir, file_name)
    File.open(f, 'w+') do |file|
      file.write content
    end
    puts "wrote #{content.length} to #{f}"
  end


  class Erb < Renderer
    def render(template, locals={})
      erb = ERB.new(read_template(template))
      inject_locals(locals)
      content = erb.result get_binding
      if block_given?
        return yield content
      end
      content
    end
<commit_msg>dead require<commit_after>#encoding: utf-8
require 'configuration'
require 'model/program'
require 'erb'
require 'fileutils'
require 'renderable'

class Renderer
  include Renderable

  def render(template, locals={})
  end

  def write(content, file_name='sessions.html', output_dir=self.output_dir)
    f = File.join(output_dir, file_name)
    File.open(f, 'w+') do |file|
      file.write content
    end
    puts "wrote #{content.length} to #{f}"
  end


  class Erb < Renderer
    def render(template, locals={})
      erb = ERB.new(read_template(template))
      inject_locals(locals)
      content = erb.result get_binding
      if block_given?
        return yield content
      end
      content
    end

{'fraction_non_alphanumeric': 0.10366275051831375, 'fraction_numerical': 0.00138217000691085, 'mean_word_length': 3.3095238095238093, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1251707', 'n_tokens_mistral': 475, 'n_tokens_neox': 466, 'n_words': 123}