code: def test_isdir_isfile(tmp_dir, dvc):
      tmp_dir.gen(
          {"datafile": "data", "datadir": {"foo": "foo", "bar": "bar"}}
      )
  
      fs = DataFileSystem(index=dvc.index.data["repo"])
      assert not fs.isdir("datadir")
      assert not fs.isfile("datadir")
      assert not fs.isdir("datafile")
      assert not fs.isfile("datafile")
  
      dvc.add(["datadir", "datafile"])
      shutil.rmtree(tmp_dir / "datadir")
      (tmp_dir / "datafile").unlink()
  
      fs = DataFileSystem(index=dvc.index.data["repo"])
      assert fs.isdir("datadir")
      assert not fs.isfile("datadir")
      assert not fs.isdir("datafile")
      assert fs.isfile("datafile")
  
imports: import posixpath
  import shutil
  import pytest
  import dvc_data
  from dvc.fs import localfs
  from dvc.fs.data import DataFileSystem
  from dvc.utils.fs import remove
  from dvc_data.hashfile.build import build
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 8 for calling a global function with example usage: test_isdir_isfile(tmp_dir, dvc) without return types