code: def test_poll2(self):
      cmd = "for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done"
      proc = subprocess.Popen(
          cmd, shell=True, stdout=subprocess.PIPE, bufsize=0
      )
      self.enterContext(proc)
      p = proc.stdout
      pollster = select.poll()
      pollster.register(p, select.POLLIN)
      for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,) * 10:
          fdlist = pollster.poll(tout)
          if fdlist == []:
              continue
          fd, flags = fdlist[0]
          if flags & select.POLLHUP:
              line = p.readline()
              if line != b"":
                  self.fail(
                      "error: pipe seems to be closed, but still returns data"
                  )
              continue
  
          elif flags & select.POLLIN:
              line = p.readline()
              if not line:
                  break
              self.assertEqual(line, b"testing...\n")
              continue
          else:
              self.fail(
                  "Unexpected return value from select.poll: %s"
                  % fdlist
              )
  
file_path: cpython/Lib/test/test_poll.py
imports: import os
  import subprocess
  import random
  import select
  import threading
  import time
  import unittest
  from test.support import cpython_only, requires_subprocess, requires_working_socket, requires_resource
  from test.support import threading_helper
  from test.support.os_helper import TESTFN
label_desc: Use image node_id 3 for calling the PollTests obj's underlying member method code with example usage: obj.test_poll2() without return types