<commit_before>module WebsocketAdapter
  class Standard
    attr_reader :env, :url

    def initialize(env, sock)
      @env = env
      @sock = sock

      secure = Rack::Request.new(env).ssl?
      scheme = secure ? 'wss:' : 'ws:'
      # FIXME: this should be generated by URI::Generic.build
      @url = scheme + '//' + env['HTTP_HOST'] + env['REQUEST_URI']

      @driver = WebSocket::Driver.rack(self, :protocols => [protocol])
      @driver.on(:close) { @sock.close unless sock.closed? }

      @driver.start
    end

    def fetch(length)
      @driver.on(:message) { |msg| yield(msg.data.pack('C*')) } if @driver.listeners(:message).length.zero?
<commit_msg>Remove the FIXME related to URL building in websocket adapter<commit_after>module WebsocketAdapter
  class Standard
    attr_reader :env, :url

    def initialize(env, sock)
      @env = env
      @sock = sock

      secure = Rack::Request.new(env).ssl?
      scheme = secure ? 'wss:' : 'ws:'
      @url = scheme + '//' + env['HTTP_HOST'] + env['REQUEST_URI']

      @driver = WebSocket::Driver.rack(self, :protocols => [protocol])
      @driver.on(:close) { @sock.close unless sock.closed? }

      @driver.start
    end

    def fetch(length)
      @driver.on(:message) { |msg| yield(msg.data.pack('C*')) } if @driver.listeners(:message).length.zero?

{'fraction_non_alphanumeric': 0.15681818181818183, 'fraction_numerical': 0.0, 'mean_word_length': 3.0646153846153847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6254303', 'n_tokens_mistral': 432, 'n_tokens_neox': 421, 'n_words': 98}