code: def test_tracked_directory_deep(M, tmp_dir, dvc, scm):
      """Test for a directory not in cwd, but nested inside other directories."""
      (tmp_dir / "sub").gen({"dir": {"foo": "foo"}})
      dvc.add(fspath(tmp_dir / "sub" / "dir"))
      scm.add_commit(
          ["sub/dir.dvc", "sub/.gitignore"], message="add sub/dir"
      )
  
      (tmp_dir / "sub" / "dir").gen("bar", "bar")
      dvc.commit(None, force=True)
      (tmp_dir / "sub" / "dir").gen("foobar", "foobar")
  
      assert dvc.data_status() == {
          **EMPTY_STATUS,
          "committed": {"modified": [join("sub", "dir", "")]},
          "uncommitted": {"modified": [join("sub", "dir", "")]},
          "git": M.dict(),
      }
      assert dvc.data_status(granular=True, untracked_files="all") == {
          **EMPTY_STATUS,
          "committed": {
              "added": [join("sub", "dir", "bar")],
              "modified": [join("sub", "dir", "")],
          },
          "uncommitted": {
              "added": [join("sub", "dir", "foobar")],
              "modified": [join("sub", "dir", "")],
          },
          "git": M.dict(),
          "unchanged": [join("sub", "dir", "foo")],
      }
  
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 4 for calling a global function with example usage: test_tracked_directory_deep(M, tmp_dir, dvc, scm) without return types