<commit_before>require 'csv_generator/version'

class CsvGenerator
  attr_reader :io

  class << self
    def generate(path, mode = 'w', permission = 0644, &block)
      File.open(path, mode, permission) do |io|
        with io, &block
      end
    end

    def with(io)
      generator = new(io)
<commit_msg>Fix parameters for .generate<commit_after>require 'csv_generator/version'

class CsvGenerator
  attr_reader :io

  class << self
    def generate(path, options = {}, &block)
      mode = options[:mode] || 'w'
      permission = options[:permission] || 0644

      File.open(path, mode, permission) do |io|
        with io, &block
      end
    end

    def with(io)
      generator = new(io)

{'fraction_non_alphanumeric': 0.11253561253561253, 'fraction_numerical': 0.011396011396011397, 'mean_word_length': 2.8, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3265394', 'n_tokens_mistral': 230, 'n_tokens_neox': 218, 'n_words': 64}