<commit_before># Each Observer is supposed to implement #handle_event
module Observable

  # Define a new list of Observers
  module Initializer
    def initialize
      @observers = []
      super
    end
  end

  def self.included(klass)
    klass.send(:prepend, Initializer)
  end

  # Inform all observers that they should handle an occurred event.
  def notify_all
    @observers.each &:handle_event
  end

  # Inform all selected observers that they should handle an occurred event.
  # @param type_name [Symbol] class name as down-cased symbol.
  def notify_all_targets_of_type(type_name)
    selected_observers = @observers.select do |observer| observer.class.to_s == type_name.to_s end<commit_msg>Fixed observer selection in Observable#notify_all_targets_of_type<commit_after># Each Observer is supposed to implement #handle_event
module Observable

  # Define a new list of Observers
  module Initializer
    def initialize
      @observers = []
      super
    end
  end

  def self.included(klass)
    klass.send(:prepend, Initializer)
  end

  # Inform all observers that they should handle an occurred event.
  def notify_all
    @observers.each &:handle_event
  end

  # Inform all selected observers that they should handle an occurred event.
  # @param type_name [Symbol] class name as down-cased symbol.
  def notify_all_targets_of_type(type_name)
    selected_observers = @observers.select do |observer| observer.class.to_s.downcase == type_name.to_s end
{'fraction_non_alphanumeric': 0.06109979633401222, 'fraction_numerical': 0.0, 'mean_word_length': 3.880794701986755, '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': '6914229', 'n_tokens_mistral': 443, 'n_tokens_neox': 435, 'n_words': 147}