code: def spawn(spec, kwargs, pass_fds=()):
      
      r, w = os.pipe()
      for fd in [r] + list(pass_fds):
          set_inheritable(fd, True)
  
      preparation_data = get_preparation_data()
  
      r_handle = get_handle(r)
      args, env = get_command_line(pipe_handle=r_handle)
      process = subprocess.Popen(args, env=env, close_fds=False)
  
      to_child = os.fdopen(w, 'wb')
      to_child.write(pickle.dumps([preparation_data, spec, kwargs]))
      to_child.close()
  
      return process
docs: Invoke a python function in a subprocess.