<commit_before>module EasyProfiler
end

require 'logger'

base_dir = File.dirname(__FILE__)
require "#{base_dir}/easy_profiler/profile"
require "#{base_dir}/easy_profiler/profile_instance_base"
require "#{base_dir}/easy_profiler/profile_instance"
require "#{base_dir}/easy_profiler/no_profile_instance"

module Kernel
  # Wraps code block into the profiling session.
  #
  # See the <tt>EasyProfiler::Profile.start</tt> method for
  # parameters description.
  #
  # Example:
  #   easy_profiler('sleep', :enabled => true) do |p|
  #     sleep 1
  #     p.progress('sleep 1')
  #     p.debug('checkpoint reached')
  #     sleep 2
  #     p.progress('sleep 2')
  #   end
  def easy_profiler(name, options = {})
    yield EasyProfiler::Profile.start(name, options)
  ensure
    EasyProfiler::Profile.stop(name)
  end
end<commit_msg>Fixed a bug when wrong exception raised on internal EasyProfiler errors<commit_after>module EasyProfiler
end

require 'logger'

base_dir = File.dirname(__FILE__)
require "#{base_dir}/easy_profiler/profile"
require "#{base_dir}/easy_profiler/profile_instance_base"
require "#{base_dir}/easy_profiler/profile_instance"
require "#{base_dir}/easy_profiler/no_profile_instance"

module Kernel
  # Wraps code block into the profiling session.
  #
  # See the <tt>EasyProfiler::Profile.start</tt> method for
  # parameters description.
  #
  # Example:
  #   easy_profiler('sleep', :enabled => true) do |p|
  #     sleep 1
  #     p.progress('sleep 1')
  #     p.debug('checkpoint reached')
  #     sleep 2
  #     p.progress('sleep 2')
  #   end
  def easy_profiler(name, options = {})
    profiler = EasyProfiler::Profile.start(name, options)
    yield profiler
  ensure
    EasyProfiler::Profile.stop(name) if profiler
  end
end
{'fraction_non_alphanumeric': 0.11801596351197263, 'fraction_numerical': 0.004561003420752566, 'mean_word_length': 4.1923076923076925, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '7082480', 'n_tokens_mistral': 595, 'n_tokens_neox': 598, 'n_words': 129}