code: def test_directory(M, tmp_dir, dvc, scm):
      tmp_dir.dvc_gen({"dir": {"foo": "foo"}}, commit="add dir")
      tmp_dir.dvc_gen(
          {"dir": {"foo": "foo", "bar": "bar", "foobar": "foobar"}}
      )
      remove(tmp_dir / "dir")
      (tmp_dir / "dir").gen({"foo": "foo", "bar": "barr", "baz": "baz"})
      tmp_dir.gen("untracked", "untracked")
  
      assert dvc.data_status() == {
          **EMPTY_STATUS,
          "committed": {"modified": [join("dir", "")]},
          "uncommitted": {"modified": [join("dir", "")]},
          "git": M.dict(),
      }
  
      assert dvc.data_status(granular=True, untracked_files="all") == {
          **EMPTY_STATUS,
          "committed": {
              "added": M.unordered(
                  join("dir", "bar"),
                  join("dir", "foobar"),
              ),
              "modified": [join("dir", "")],
          },
          "uncommitted": {
              "added": [join("dir", "baz")],
              "modified": M.unordered(
                  join("dir", ""), join("dir", "bar")
              ),
              "deleted": [join("dir", "foobar")],
          },
          "git": M.dict(),
          "not_in_cache": [],
          "unchanged": [join("dir", "foo")],
          "untracked": ["untracked"],
      }
  
imports: from os import fspath
  from os.path import join
  import pytest
  from dvc.repo import Repo
  from dvc.repo.data import _transform_git_paths_to_dvc, posixpath_to_os_path
  from dvc.testing.tmp_dir import make_subrepo
  from dvc.utils.fs import remove
label_desc: Use image node_id 3 for calling a global function with example usage: test_directory(M, tmp_dir, dvc, scm) without return types