<commit_before>require "ult/dir"

def safety( &block )
  root_dir = pwd
  result = nil
  begin
    block.call
  rescue Exception => e
    result = e
  rescue StandardError => e
    result = e
  ensure
    dir( root_dir ) if root_dir != pwd
    result
  end
end<commit_msg>fix safety<commit_after>require "ult/dir"

def safety( &block )
  root_dir = pwd
  result = nil
  begin
    block.call
  rescue Exception => e
    result = e
  rescue StandardError => e
    result = e
  end
  dir( root_dir ) if root_dir != pwd
  result
end
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.0, 'mean_word_length': 2.6482758620689655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5677440', 'n_tokens_mistral': 183, 'n_tokens_neox': 186, 'n_words': 59}