code: def scratch_dir():
      # This should always be set if doing MG testing, since temporary
      # directories are only accessible from the current process.
      tempdir_object = os.getenv(
          "RAPIDS_PYTEST_SCRATCH_DIR", tempfile.TemporaryDirectory()
      )
  
      if isinstance(tempdir_object, tempfile.TemporaryDirectory):
          yield tempdir_object.name
      else:
          yield tempdir_object
  
      del tempdir_object
  
imports: import pytest
  from cugraph.testing.mg_utils import start_dask_client, stop_dask_client
  import os
  import tempfile
  from dask_cuda.utils_test import IncreasedCloseTimeoutNanny
label_desc: Use image node_id 2 for calling a global function with example usage: scratch_dir() without return types