code: def _read_select_kqueue(k_queue):
          
          npipes = len(NonBlockingStreamReader._streams)
          # Create list of kevent objects
          # pylint: disable=no-member
          kevents = [select.kevent(s.stream.fileno(),
                                   filter=select.KQ_FILTER_READ,
                                   flags=select.KQ_EV_ADD | select.KQ_EV_ENABLE)
                     for s in NonBlockingStreamReader._streams]
          while NonBlockingStreamReader._run_flag:
              events = k_queue.control(kevents, npipes, 0.5)  # Wake up twice in second
              for event in events:
                  if event.filter == select.KQ_FILTER_READ:  # pylint: disable=no-member
                      NonBlockingStreamReader._read_fd(event.ident)
              # Check if new pipes added.
              if npipes != len(NonBlockingStreamReader._streams):
                  return
docs: Read PIPES using BSD Kqueue