<commit_before>require 'optparse'

module Daemon
  VERSION="0.1"
  attr_writer :daemon_disable
  
  def daemon_start
    return if @daemon_disable || daemon_running?
    daemon_init
    open(@daemon_pid_file, "w") {|f| f.write("")}
    Process.daemon
    @daemon_pid = $$
    open(@daemon_pid_file, "w") {|f| f.write(@daemon_pid)}
    $0 = @daemon_name
    at_exit {daemon_stop}
    self
  end
  
  def daemon_stop
    daemon_init
    Process.kill "TERM", daemon_pid
    File.delete(@daemon_pid_file) if @daemon_pid_file != "/dev/null"
  rescue StandardError, SystemCallError
  ensure
    self
  end
  <commit_msg>Version 0.2<commit_after>require 'optparse'

module Daemon
  VERSION="0.2"
  attr_writer :daemon_disable
  
  def daemon_start
    return if @daemon_disable || daemon_running?
    daemon_init
    open(@daemon_pid_file, "w") {|f| f.write("")}
    Process.daemon
    @daemon_pid = $$
    open(@daemon_pid_file, "w") {|f| f.write(@daemon_pid)}
    $0 = @daemon_name
    at_exit {daemon_stop}
    self
  end
  
  def daemon_stop
    daemon_init
    Process.kill "TERM", daemon_pid
    File.delete(@daemon_pid_file) if @daemon_pid_file != "/dev/null"
  rescue StandardError, SystemCallError
  ensure
    self
  end
  
{'fraction_non_alphanumeric': 0.1133768352365416, 'fraction_numerical': 0.0065252854812398045, 'mean_word_length': 3.461818181818182, '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': '1491241', 'n_tokens_mistral': 475, 'n_tokens_neox': 473, 'n_words': 93}