<commit_before>module EventStore
  module Client
    module HTTP
      module Request
        def self.included(cls)
          cls.extend Logger
          cls.extend Build
          cls.extend Configure

          cls.send :dependency, :logger, Telemetry::Logger
          cls.send :dependency, :session, EventStore::Client::HTTP::Session
        end

        module Build
          def build(session: nil)
            new(session).tap do |instance|
              Telemetry::Logger.configure instance
              instance.configure_session(session)
            end
          end
        end

        module Configure
          def configure(receiver, attr_name=nil, session: nil)
            attr_name ||= :request

            logger.trace "Configuring request (Receiver: #{receiver})"
            request = build session: session
            receiver.send "#{attr_name}=", request
            logger.debug "Configured request (Receiver: #{receiver})"

            request
          end
        end

        module Logger
          def logger
            Telemetry::Logger.get self
          end
        end

        def initialize(session)
          @session = session
        end

        def configure_session(session=nil)
          if session.nil?
            Session.configure self
          else
            self.session = session
          end
        end
      end
    end
  end
end
<commit_msg>Dependencies are not set via initializers<commit_after>module EventStore
  module Client
    module HTTP
      module Request
        def self.included(cls)
          cls.extend Logger
          cls.extend Build
          cls.extend Configure

          cls.send :dependency, :logger, Telemetry::Logger
          cls.send :dependency, :session, EventStore::Client::HTTP::Session
        end

        module Build
          def build(session: nil)
            new.tap do |instance|
              Telemetry::Logger.configure instance
              instance.configure_session(session)
            end
          end
        end

        module Configure
          def configure(receiver, attr_name=nil, session: nil)
            attr_name ||= :request

            logger.trace "Configuring request (Receiver: #{receiver})"
            request = build session: session
            receiver.send "#{attr_name}=", request
            logger.debug "Configured request (Receiver: #{receiver})"

            request
          end
        end

        module Logger
          def logger
            Telemetry::Logger.get self
          end
        end

        def configure_session(session=nil)
          if session.nil?
            Session.configure self
          else
            self.session = session
          end
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.06601378309756982, 'fraction_numerical': 0.0, 'mean_word_length': 1.5513413506012952, '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': '1442978', 'n_tokens_mistral': 667, 'n_tokens_neox': 646, 'n_words': 192}