<commit_before>module Signal
  def self.register_shutdown_handler(&block)
    %w(QUIT INT TERM).each do |sig|
      old = trap(sig) {}
      trap(sig) { block.call; old.call }<commit_msg>signal: use exit and at_exit handlers during shutdown<commit_after>module Signal
  def self.register_shutdown_handler(&block)
    at_exit(&block)
    %w(QUIT INT TERM).each do |sig|
      trap(sig) { exit(-1) }
{'fraction_non_alphanumeric': 0.12342569269521411, 'fraction_numerical': 0.0025188916876574307, 'mean_word_length': 4.037974683544304, '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': '638138', 'n_tokens_mistral': 141, 'n_tokens_neox': 136, 'n_words': 33}