code: def test_tempdir(shutdown_only):
      shutil.rmtree(
          ray._private.utils.get_ray_temp_dir(), ignore_errors=True
      )
      if os.path.exists(ray._private.utils.get_ray_temp_dir()):
          # sometimes even after delete, it's still there.
          # delete it again to make sure it's cleaned up
          shutil.rmtree(
              ray._private.utils.get_ray_temp_dir(), ignore_errors=True
          )
          assert not os.path.exists(
              ray._private.utils.get_ray_temp_dir()
          )
  
      ray.init(
          _temp_dir=os.path.join(
              ray._private.utils.get_user_temp_dir(), "i_am_a_temp_dir"
          )
      )
      assert os.path.exists(
          os.path.join(
              ray._private.utils.get_user_temp_dir(), "i_am_a_temp_dir"
          )
      ), "Specified temp dir not found."
      assert not os.path.exists(
          ray._private.utils.get_ray_temp_dir()
      ), "Default temp dir should not exist."
      shutil.rmtree(
          os.path.join(
              ray._private.utils.get_user_temp_dir(), "i_am_a_temp_dir"
          ),
          ignore_errors=True,
      )
  
file_path: ray/python/ray/tests/test_tempfile.py
imports: import os
  import shutil
  import sys
  import time
  import pytest
  import ray
  from ray._private.test_utils import check_call_ray, wait_for_condition
label_desc: Use image node_id 4 for calling a global function with example usage: test_tempdir(shutdown_only) without return types