code: def test_cudf_import_no_cuinit(cuda_gdb):
      # When RAPIDS_NO_INITIALIZE is set, importing cudf should _not_
      # create a CUDA context (i.e. cuInit should not be called).
      # Intercepting the call to cuInit programmatically is tricky since
      # the way it is resolved from dynamic libraries by
      # cuda-python/numba/cupy is multitudinous (see discussion at
      # https://github.com/rapidsai/cudf/pull/12361 which does this, but
      # needs provide hooks that override dlsym, cuGetProcAddress, and
      # cuInit.
      # Instead, we just run under GDB and see if we hit a breakpoint
      env = os.environ.copy()
      env["RAPIDS_NO_INITIALIZE"] = "1"
      output = subprocess.run(
          [
              cuda_gdb,
              "-x",
              "-",
              "--args",
              sys.executable,
              "-c",
              "import cudf",
          ],
          input=GDB_COMMANDS,
          env=env,
          capture_output=True,
          text=True,
          cwd="/",
      )
  
      cuInit_called = output.stdout.find("in cuInit ()")
      print("Command output:\n")
      print("*** STDOUT ***")
      print(output.stdout)
      print("*** STDERR ***")
      print(output.stderr)
      assert output.returncode == 0
      assert cuInit_called < 0
  
imports: import os
  import subprocess
  import sys
  from shutil import which
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_cudf_import_no_cuinit(cuda_gdb) without return types