code: def test_pipe_read_length(self):
      pipe = Pipe()
      pipe.write("abcdefg")
      for c in "abcdefg":
          r = pipe.read(length=1)
          self.assertEqual(c, r)
  
      pipe.write("∀∁∂∃∄∅")
      self.assertEqual("∀∁∂", pipe.read(length=3))
      self.assertEqual("∃∄∅", pipe.read(length=3))
  
      pipe.write("∍∎∏∐∑⌚⌛⛄✅…")
      self.assertEqual("∍∎∏∐∑⌚", pipe.read(length=6))
      self.assertEqual("⌛⛄✅…", pipe.read(length=6))
  
      pipe.write("∆∇∈∉")
      self.assertEqual("∆∇∈∉", pipe.read(length=4))
  
      pipe.write("∊∋∌")
      self.assertEqual("∊∋∌", pipe.read(length=4))
  
      pipe.write("∀∁∂∃∄∅")
      self.assertEqual("∀∁∂", pipe.read(length=3))
      self.assertEqual("∃∄∅", pipe.read())
  
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 7 for calling the UtilTests obj's underlying member method code with example usage: obj.test_pipe_read_length() without return types