<commit_before>module Freevoice
  module Observable

    def add_observer!(object)
      @observers ||= []
      @observers << object
    end

    def remove_observer!(object)
      @observers.delete(object)
    end

    def clear_observers!
      @observers = []
    end

    # Like an observer stack which only notifies top observer
    def notify_current_observer(event, data=nil)
      return unless @observers
      obs = @observers.last<commit_msg>fix remove observer when observers not init<commit_after>module Freevoice
  module Observable

    def add_observer!(object)
      @observers ||= []
      @observers << object
    end

    def remove_observer!(object)
      @observers && @observers.delete(object)
    end

    def clear_observers!
      @observers = []
    end

    # Like an observer stack which only notifies top observer
    def notify_current_observer(event, data=nil)
      return unless @observers
      obs = @observers.last
{'fraction_non_alphanumeric': 0.07878151260504201, 'fraction_numerical': 0.0, 'mean_word_length': 2.921810699588477, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1851191', 'n_tokens_mistral': 278, 'n_tokens_neox': 277, 'n_words': 76}