code: def _read_stream(fd, fn):
      """Reads bytes from a file descriptor, utf-8 decodes them, and passes them
      to the provided callback function on the next IOLoop tick.
      Assumes fd.read will block and should be used in a thread.
      Parameters
      ----------
      fd : file
          File descriptor to read
      fn : callable(str) -> None
          Callback function that handles chunks of text
      """
      while True:
          # Specify a max read size so the read doesn't block indefinitely
          # Using a value less than the typical default max pipe size
          # and greater than a single system page.
          buff = fd.read(8192)
          if buff:
              fn(buff.decode("utf-8"))
  
imports: from bigdl.util.common import *
  from zoo.common.utils import callZooFunc
  from zoo.util.utils import set_python_home
  import warnings
  import multiprocessing
  import os
  import threading
  import sys
label_desc: Use image node_id 6 for calling a global function with example usage: _read_stream(fd, fn) without return types