code: def spawn(onParent, onChild):
      """a unidirectional fork wrapper
  
      Calls onParent(pid, fromchild) in parent process,
            onChild(pid, toparent) in child process.
      """
      c2pread, c2pwrite = os.pipe()
  
      pid = os.fork()
      if pid > 0:
          os.close(c2pwrite)
          fromchild = os.fdopen(c2pread, "rb")
          return onParent(pid, fromchild)
  
      os.close(c2pread)
      toparent = os.fdopen(c2pwrite, "wb", 0)
      pid = os.getpid()
  
      return onChild(pid, toparent)
  
imports: import os
label_desc: Use image node_id 4 for calling a global function with example usage: spawn(onParent, onChild) and returns: onChild, onParent