<commit_before>begin
    to_process = []
    h2g = H2.new
    host = ARGV[0] || "www.fastly.com"
    h2g.connect(host)
    h2g.send_prefix()
    h2g.send_settings()
    # Ack settings
    while true do
        f = h2g.read(-1)
        puts f.to_s
        if f.type == "SETTINGS" and (f.flags & 1 == 1) then
            next
        elsif f.type == "SETTINGS" then
            h2g.send_settings_ack()
            break
        else
            to_process << f
        end
    end
    to_process.each do |f|
        p f.type
    end

    h2g.send_priority(3, 0, 1, 201)
    h2g.send_priority(5, 0, 0, 101)
    h2g.send_priority(7, 0, 0, 1)
    h2g.send_priority(9, 7, 0, 1)
    h2g.send_priority(11, 3, 0, 1)
    prio_low = H2Priority.new(0, 0, 16)
    prio_high = H2Priority.new(0, 0, 32)
    #sleep 6
    #exit 0
    h2g.getp("/big?1", 15, prio_low)
    h2g.getp("/big?2", 17, prio_high)
    while true
        f = h2g.read(-1)
        puts "type:#{f.type}, stream_id:#{f.stream_id}, len:#{f.len}"
        if f.type == "GOAWAY" then
            puts f.to_s
        end
        if f.type == "DATA" then
            h2g.send_window_update(0, f.len)
            h2g.send_window_update(f.stream_id, f.len)
        end
    end
rescue => e
    p e
end<commit_msg>Cleanup the .rb script<commit_after>begin
    to_process = []
    h2g = H2.new
    host = ARGV[0] || "www.fastly.com"
    h2g.connect(host)
    h2g.send_prefix()
    h2g.send_settings()
    # Ack settings
    while true do
        f = h2g.read(-1)
        puts f.to_s
        if f.type == "SETTINGS" and (f.flags & 1 == 1) then
            next
        elsif f.type == "SETTINGS" then
            h2g.send_settings_ack()
            break
        else
            to_process << f
        end
    end
    to_process.each do |f|
        puts f.to_s
    end

    h2g.send_priority(3, 0, 1, 201)
    h2g.send_priority(5, 0, 0, 101)
    h2g.send_priority(7, 0, 0, 1)
    h2g.send_priority(9, 7, 0, 1)
    h2g.send_priority(11, 3, 0, 1)
    prio_low = H2Priority.new(0, 0, 16)
    prio_high = H2Priority.new(0, 0, 32)
    h2g.getp("/big?1", 15, prio_low)
    h2g.getp("/big?2", 17, prio_high)
    while true
        f = h2g.read(-1)
        puts "type:#{f.type}, stream_id:#{f.stream_id}, len:#{f.len}"
        if f.type == "GOAWAY" or f.type == "SETTINGS" then
            puts f.to_s
        end
        if f.type == "DATA" then
            h2g.send_window_update(0, f.len)
            h2g.send_window_update(f.stream_id, f.len)
        end
    end
rescue => e
    p e
end
{'fraction_non_alphanumeric': 0.13465346534653466, 'fraction_numerical': 0.05148514851485148, 'mean_word_length': 1.763676148796499, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1482906', 'n_tokens_mistral': 1095, 'n_tokens_neox': 1036, 'n_words': 227}