<commit_before>require 'assembler'
require 'base64'
require 'manager/version'
require 'consistent_hashing'
require 'daemons'
require 'faraday'
require 'faraday_middleware'
require 'json'
require 'logger'
require 'ostruct'
require 'pry'
require 'yaml'

Thread.abort_on_exception = true

class Manager
  def self.pids
    @pids ||= {}
  end

  def self.exec(name, script)
    pid = Process.fork
    if pid.nil?
      Kernel.exec script
    else
      pids[name] = pid
    end
  end

  def self.daemons<commit_msg>fork, not exec<commit_after>require 'assembler'
require 'base64'
require 'manager/version'
require 'consistent_hashing'
require 'daemons'
require 'faraday'
require 'faraday_middleware'
require 'json'
require 'logger'
require 'ostruct'
require 'pry'
require 'yaml'

Thread.abort_on_exception = true

class Manager
  def self.pids
    @pids ||= {}
  end

  def self.fork(name, &block)
    pid = Process.fork
    if pid.nil?
      block.call
    else
      pids[name] = pid
    end
  end

  def self.daemons
{'fraction_non_alphanumeric': 0.10049261083743842, 'fraction_numerical': 0.003940886699507389, 'mean_word_length': 3.7476635514018692, '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': '2918065', 'n_tokens_mistral': 367, 'n_tokens_neox': 353, 'n_words': 96}