code: def execute(np, cmd, args=""):
      mpi4pyroot = os.path.abspath(os.path.dirname(mpi4py.__path__[0]))
      pythonpath = os.environ.get("PYTHONPATH", "").split(os.pathsep)
      pythonpath.insert(0, mpi4pyroot)
  
      mpiexec = launcher(np)
      if isinstance(cmd, str):
          cmd = shlex.split(cmd)
      if isinstance(args, str):
          args = shlex.split(args)
      command = mpiexec + cmd + args
  
      env = os.environ.copy()
      env["PYTHONPATH"] = os.pathsep.join(pythonpath)
      env["PYTHONUNBUFFERED"] = "1"
  
      p = subprocess.Popen(
          command,
          env=env,
          stdout=subprocess.PIPE,
          stderr=subprocess.PIPE,
      )
      stdout, stderr = p.communicate()
      return p.returncode, stdout.decode(), stderr.decode()
  
imports: import sys
  import os
  import shlex
  import shutil
  import warnings
  import subprocess
  import unittest
  import mpi4py
label_desc: Use image node_id 4 for calling a global function with example usage: execute(np, cmd, args) and returns: p,  stdout,  stderr