code: def test_get_hash_dirty_dir(tmp_dir, dvc):
      tmp_dir.dvc_gen({"dir": {"foo": "foo", "bar": "bar"}})
      (tmp_dir / "dir" / "baz").write_text("baz")
  
      fs = DataFileSystem(index=dvc.index.data["repo"])
      expected = "5ea40360f5b4ec688df672a4db9c17d1.dir"
      assert fs.info("dir").get("md5") == expected
      _, _, obj = build(dvc.cache.local, "dir", fs, "md5", dry_run=True)
      assert obj.hash_info == HashInfo("md5", expected)
  
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 18 for calling a global function with example usage: test_get_hash_dirty_dir(tmp_dir, dvc) without return types