code: def _run_script(code):
      # subprocess is required not to interfere with cupy module imported in top
      # of this file
      temp_dir = tempfile.mkdtemp()
      try:
          script_path = os.path.join(temp_dir, "script.py")
          with open(script_path, "w") as f:
              f.write(code)
          proc = subprocess.Popen(
              [sys.executable, script_path],
              stdout=subprocess.PIPE,
              stderr=subprocess.PIPE,
          )
          stdoutdata, stderrdata = proc.communicate()
      finally:
          shutil.rmtree(temp_dir, ignore_errors=True)
      return proc.returncode, stdoutdata, stderrdata
  
imports: import operator
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  import unittest
  from unittest import mock
  import numpy
  import pytest
  import cupy
  import cupyx
label_desc: Use image node_id 1 for calling a global function with example usage: _run_script(code) and returns: proc,  stdoutdata,  stderrdata