code: def test_exists_isdir_isfile_dirty(tmp_dir, dvc):
      tmp_dir.dvc_gen(
          {"datafile": "data", "datadir": {"foo": "foo", "bar": "bar"}}
      )
  
      fs = DVCFileSystem(repo=dvc)
      shutil.rmtree(tmp_dir / "datadir")
      (tmp_dir / "datafile").unlink()
  
      assert fs.exists("datafile")
      assert fs.exists("datadir")
      assert fs.exists("datadir/foo")
      assert fs.isfile("datafile")
      assert not fs.isfile("datadir")
      assert fs.isfile("datadir/foo")
      assert not fs.isdir("datafile")
      assert fs.isdir("datadir")
      assert not fs.isdir("datadir/foo")
  
      # NOTE: creating file instead of dir and dir instead of file
      tmp_dir.gen(
          {"datadir": "data", "datafile": {"foo": "foo", "bar": "bar"}}
      )
      assert fs.exists("datafile")
      assert fs.exists("datadir")
      assert not fs.exists("datadir/foo")
      assert fs.exists("datafile/foo")
      assert not fs.isfile("datafile")
      assert fs.isfile("datadir")
      assert not fs.isfile("datadir/foo")
      assert fs.isfile("datafile/foo")
      assert fs.isdir("datafile")
      assert not fs.isdir("datadir")
      assert not fs.isdir("datadir/foo")
      assert not fs.isdir("datafile/foo")
  
imports: import os
  import posixpath
  import shutil
  import pytest
  from fsspec.utils import tokenize
  from dvc.fs import localfs
  from dvc.fs.dvc import DVCFileSystem
  from dvc.testing.tmp_dir import make_subrepo
  from dvc_data.hashfile.build import build
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 7 for calling a global function with example usage: test_exists_isdir_isfile_dirty(tmp_dir, dvc) without return types