<commit_before># encoding: UTF-8
module ActionWebService # :nodoc:
  module Protocol # :nodoc:
    module Discovery # :nodoc:
      def self.included(base)
        base.send(:class_attribute, :web_service_protocols)
        base.extend(ClassMethods)
        base.send(:include, ActionWebService::Protocol::Discovery::InstanceMethods)
      end

      module ClassMethods # :nodoc:
        def register_protocol(klass)
          self.web_service_protocols = [klass]
        end
      end

      module InstanceMethods # :nodoc:
        private

        def discover_web_service_request(action_pack_request)
          (self.class.web_service_protocols || []).each do |web_service_protocol|
            protocol = web_service_protocol.create(self)
            request = protocol.decode_action_pack_request(action_pack_request)
            return request unless request.nil?
          end
          nil
        end
<commit_msg>we want multiple protocols available<commit_after># encoding: UTF-8
module ActionWebService # :nodoc:
  module Protocol # :nodoc:
    module Discovery # :nodoc:
      def self.included(base)
        base.send(:class_attribute, :web_service_protocols)
        base.extend(ClassMethods)
        base.send(:include, ActionWebService::Protocol::Discovery::InstanceMethods)
      end

      module ClassMethods # :nodoc:
        def register_protocol(klass)
          unless self.web_service_protocols.present?
            self.web_service_protocols = Array.new
          end
          self.web_service_protocols << klass
        end
      end

      module InstanceMethods # :nodoc:
        private

        def discover_web_service_request(action_pack_request)
          (self.class.web_service_protocols || []).each do |web_service_protocol|
            protocol = web_service_protocol.create(self)
            request = protocol.decode_action_pack_request(action_pack_request)
            return request unless request.nil?
          end
          nil
        end

{'fraction_non_alphanumeric': 0.07603222557905337, 'fraction_numerical': 0.0010070493454179255, 'mean_word_length': 2.6325411334552102, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7310698', 'n_tokens_mistral': 543, 'n_tokens_neox': 535, 'n_words': 109}