code: def test_modified_subrepo(tmp_dir, scm, dvc):
      from dvc.repo import Repo
  
      tmp_dir.gen({"subdir": {"file": "first"}})
      subrepo_dir = tmp_dir / "subdir"
  
      with subrepo_dir.chdir():
          subrepo = Repo.init(subdir=True)
          subrepo.add("file")
  
      scm.add(os.path.join("subdir", "file.dvc"))
      scm.commit("init")
  
      (subrepo_dir / "file").write_text("second")
  
      with subrepo_dir.chdir():
          subrepo = Repo()
          assert subrepo.diff() == {
              "added": [],
              "deleted": [],
              "modified": [
                  {
                      "path": "file",
                      "hash": {
                          "old": digest("first"),
                          "new": digest("second"),
                      },
                  }
              ],
              "not in cache": [],
              "renamed": [],
          }
  
imports: import hashlib
  import os
  import pytest
  from funcy import first
  from dvc.exceptions import DvcException
  from dvc.utils.fs import remove
label_desc: Use image node_id 9 for calling a global function with example usage: test_modified_subrepo(tmp_dir, scm, dvc) without return types