code: def assert_file(exists: bool, root: str, path: str):
      full_path = os.path.join(root, path)
  
      if exists:
          assert os.path.exists(full_path)
      else:
          assert not os.path.exists(full_path)
  
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 3 for calling a global function with example usage: assert_file(exists, root, path) without return types