code: def temp_data_dirs():
      tmp_source = os.path.realpath(tempfile.mkdtemp())
      tmp_target = os.path.realpath(tempfile.mkdtemp())
  
      os.makedirs(os.path.join(tmp_source, "subdir", "nested"))
      os.makedirs(
          os.path.join(tmp_source, "subdir_exclude", "something")
      )
  
      files = [
          "level0.txt",
          "level0_exclude.txt",
          "subdir/level1.txt",
          "subdir/level1_exclude.txt",
          "subdir/nested/level2.txt",
          "subdir_nested_level2_exclude.txt",
          "subdir_exclude/something/somewhere.txt",
      ]
  
      for file in files:
          with open(os.path.join(tmp_source, file), "w") as f:
              f.write("Data")
  
      yield tmp_source, tmp_target
  
      shutil.rmtree(tmp_source)
      shutil.rmtree(tmp_target)
  
file_path: ray/python/ray/tune/tests/test_util_file_transfer.py
imports: import io
  import tarfile
  import os
  import pytest
  import shutil
  import tempfile
  from ray.exceptions import RayTaskError
  from ray.tune.utils.file_transfer import _sync_dir_between_different_nodes, _sync_dir_on_same_node
  import ray.util
label_desc: Use image node_id 2 for calling a global function with example usage: temp_data_dirs() without return types