<commit_before>module Sequement

  # A fork-friendly wrapper around IO#pipe.
  #
  #   pipe = Sequement::Pipe.new
  #
  #   if fork
  #     # select the writer, thus closing the reader
  #     pipe.writer!.puts 'IPC'
  #   else
  #     # select the reader, thus closing the writer
  #     puts pipe.reader!.gets
  #   end
  #
  class Pipe

    def initialize
      @reader, @writer = IO.pipe
    end

    def reader!
      select_role :reader
    end<commit_msg>Sequement::Pipe has attr_reader for its underlying reader and writer pipes.<commit_after>module Sequement

  # A fork-friendly wrapper around IO#pipe.
  #
  #   pipe = Sequement::Pipe.new
  #
  #   if fork
  #     # select the writer, thus closing the reader
  #     pipe.writer!.puts 'IPC'
  #   else
  #     # select the reader, thus closing the writer
  #     puts pipe.reader!.gets
  #   end
  #
  class Pipe

    attr_reader :reader, :writer

    def initialize
      @reader, @writer = IO.pipe
    end

    def reader!
      select_role :reader
    end
{'fraction_non_alphanumeric': 0.08627450980392157, 'fraction_numerical': 0.0, 'mean_word_length': 2.2412698412698413, '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': '1410002', 'n_tokens_mistral': 338, 'n_tokens_neox': 327, 'n_words': 99}