code: def test_partial_checkout_and_update(M, tmp_dir, dvc, remote):
      dir1 = {f"{i}.txt": f"dir1 {i}" for i in range(10)}
      dir2 = {f"{i}.txt": f"dir2 {i}" for i in range(10)}
      tmp_dir.gen(
          {"dir": {"foo": "foo", "subdir": dir1, "subdir2": dir2}}
      )
  
      (stage,) = dvc.add("dir")
      out = stage.outs[0]
  
      assert out.hash_info == HashInfo(
          "md5", "9899dc38082ee0ec33de077df62a4a12.dir"
      )
      assert out.meta == Meta(isdir=True, size=123, nfiles=21)
  
      assert dvc.push() == 22
      dvc.cache.local.clear()
      shutil.rmtree("dir")
  
      assert dvc.pull("dir/subdir") == M.dict(
          added=[join("dir", "")], fetched=11
      )
      assert (tmp_dir / "dir").read_text() == {"subdir": dir1}
  
      tmp_dir.gen({"dir": {"subdir": {"file": "file"}}})
      (stage,) = dvc.add(join("dir", "subdir", "file"))
  
      out = stage.outs[0]
      assert out.hash_info == HashInfo(
          "md5", "e7531c3930f28a00edc25e6cef91db03.dir"
      )
      assert out.meta == Meta(isdir=True, size=127, nfiles=22)
      assert dvc.push() == 2
  
file_path: dvc/tests/func/test_virtual_directory.py
imports: import shutil
  from os.path import join
  from dvc_data.hashfile.hash_info import HashInfo
  from dvc_data.hashfile.meta import Meta
label_desc: Use image node_id 6 for calling a global function with example usage: test_partial_checkout_and_update(M, tmp_dir, dvc, remote) without return types