code: def run_cmd(cmd, workdir):
      cwd = os.getcwd()
      if workdir:
          os.chdir(workdir)
      result = subprocess.run(
          cmd,
          check=False,
          shell=True,
          stdout=subprocess.PIPE,
          stderr=subprocess.STDOUT,
      )
      out = result.stdout.decode("utf-8").rstrip()
      if workdir:
          os.chdir(cwd)
      return result.returncode, out
  
file_path: cuml/cpp/scripts/cuda-memcheck.py
imports: from __future__ import print_function
  import os
  import subprocess
  import argparse
  import time
  import re
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: run_cmd(cmd, workdir) and returns: result,  out