code: def test_sync_nodes_only_diff(ray_start_2_cpus, temp_data_dirs):
      """Check that only differing files are synced between nodes"""
      tmp_source, tmp_target = temp_data_dirs
  
      # Sanity check
      assert_file(True, tmp_source, "level0.txt")
      assert_file(True, tmp_source, "subdir/level1.txt")
      assert_file(False, tmp_target, "level0.txt")
      assert_file(False, tmp_target, "level0_new.txt")
  
      node_ip = ray.util.get_node_ip_address()
      _sync_dir_between_different_nodes(
          source_ip=node_ip,
          source_path=tmp_source,
          target_ip=node_ip,
          target_path=tmp_target,
      )
  
      assert_file(True, tmp_source, "level0.txt")
      assert_file(True, tmp_target, "level0.txt")
      assert_file(True, tmp_target, "subdir/level1.txt")
      assert_file(False, tmp_target, "level0_new.txt")
  
      # Add new file
      with open(os.path.join(tmp_source, "level0_new.txt"), "w") as f:
          f.write("Data\n")
  
      # Modify existing file
      with open(
          os.path.join(tmp_source, "subdir", "level1.txt"), "w"
      ) as f:
          f.write("New data\n")
  
      (
          unpack,
          pack_actor,
          files_stats,
      ) = _sync_dir_between_different_nodes(
          source_ip=node_ip,
          source_path=tmp_source,
          target_ip=node_ip,
          target_path=tmp_target,
          return_futures=True,
      )
  
      files_stats = ray.get(files_stats)
      tarball = ray.get(pack_actor.get_full_data.remote())
  
      assert "./level0.txt" in files_stats
      assert (
          "./level0_new.txt" not in files_stats
      )  # Was not in target dir
      assert "subdir/level1.txt" in files_stats
  
      with tarfile.open(fileobj=io.BytesIO(tarball)) as tar:
          files_in_tar = tar.getnames()
          assert "./level0.txt" not in files_in_tar
          assert "./level0_new.txt" in files_in_tar
          assert "subdir/level1.txt" in files_in_tar
          assert (
              len(files_in_tar) == 7
          )  # 3 files, 4 dirs (including root)
  
      ray.get(unpack)
  
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 5 for calling a global function with example usage: test_sync_nodes_only_diff(ray_start_2_cpus, temp_data_dirs) without return types