code: def childscript():
      from tempfile import mkstemp
      from textwrap import dedent
  
      fd, script = mkstemp(suffix=".py", prefix="mpi4py-")
      os.close(fd)
      python = sys.executable
      pypath = MPI4PYPATH
      with open(script, "w") as f:
          f.write(
              dedent(
                  f"""\
          #!{python}
          import sys; sys.path.insert(0, "{pypath}")
          from mpi4py import MPI
          parent = MPI.Comm.Get_parent()
          parent.Barrier()
          parent.Disconnect()
          assert parent == MPI.COMM_NULL
          parent = MPI.Comm.Get_parent()
          assert parent == MPI.COMM_NULL
          """
              )
          )
      os.chmod(script, int("770", 8))
      return script
  
imports: from mpi4py import MPI
  import mpiunittest
  import sys, os, mpi4py
label_desc: Use image node_id 1 for calling a global function with example usage: childscript() and returns: script