<commit_before>module Syncro
  module Scriber
    class ScribeObserver
      include Singleton
    
      def after_create(rec)
        if rec.clients.blank?
          clients = Client.all.reject {|client| 
            client.to_s == rec.from_client
          }
        else
          clients = rec.clients.map {|r| Client.for(r) }
        end
        
        clients.each {|c| c.add_scribe(rec) }
      end
    
      def update(observed_method, object) #:nodoc:
        send(observed_method, object) if respond_to?(observed_method)
      end

      def observed_class_inherited(subclass) #:nodoc:
        subclass.add_observer(self)
      end
    end
  end
end
<commit_msg>make sure clients are unique<commit_after>module Syncro
  module Scriber
    class ScribeObserver
      include Singleton
    
      def after_create(rec)
        if rec.clients.blank?
          clients = Client.all.reject {|client| 
            client.to_s == rec.from_client
          }
        else
          clients = rec.clients.map {|r| Client.for(r) }
        end
        clients.uniq!
        clients.each {|c| c.add_scribe(rec) }
      end
    
      def update(observed_method, object) #:nodoc:
        send(observed_method, object) if respond_to?(observed_method)
      end

      def observed_class_inherited(subclass) #:nodoc:
        subclass.add_observer(self)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08405797101449275, 'fraction_numerical': 0.0, 'mean_word_length': 2.002173913043478, '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': '4108001', 'n_tokens_mistral': 442, 'n_tokens_neox': 436, 'n_words': 93}