code: def test_pipe_blocking(self):
      buf = []
      timeout = 1.0
  
      def read():
          buf.append(pipe.read())
  
      def write(content):
          pipe.write(content)
  
      pipe = Pipe()
  
      pipe.write("first")
      thread = in_thread(write, ("second",))
      thread.join(timeout)
  
      self.assertEqual(True, thread.is_alive())
      self.assertEqual("first", pipe.read())
      self.assertEqual("second", pipe.read())
      thread.join(timeout)
      self.assertEqual(False, thread.is_alive())
  
      thread = in_thread(read)
      thread.join(timeout)
      self.assertEqual(True, thread.is_alive())
  
      pipe.write("third")
      thread.join(timeout)
      self.assertEqual(False, thread.is_alive())
      self.assertEqual(["third"], buf)
  
file_path: horovod/test/single/test_util.py
imports: import unittest
  from horovod.runner.util.streams import Pipe
  from horovod.runner.util.threads import in_thread
label_desc: Use image node_id 8 for calling the UtilTests obj's underlying member method code with example usage: obj.test_pipe_blocking() without return types