code: def waitfinish(self, waiter=os.waitpid):
      pid, systemstatus = waiter(self.pid, 0)
      if systemstatus:
          if os.WIFSIGNALED(systemstatus):
              exitstatus = os.WTERMSIG(systemstatus) + 128
          else:
              exitstatus = os.WEXITSTATUS(systemstatus)
      else:
          exitstatus = 0
      signal = systemstatus & 0x7F
      if not exitstatus and not signal:
          retval = self.RETVAL.open("rb")
          try:
              retval_data = retval.read()
          finally:
              retval.close()
          retval = marshal.loads(retval_data)
      else:
          retval = None
      stdout = self.STDOUT.read()
      stderr = self.STDERR.read()
      self._removetemp()
      return Result(exitstatus, signal, retval, stdout, stderr)
  
file_path: catboost/contrib/python/py/py3/py/_process/forkedfunc.py
imports: import py
  import os
  import sys
  import marshal
label_desc: Use image node_id 3 for calling the ForkedFunc obj's underlying member method code with example usage: obj.waitfinish(waiter) and returns: Result