code: def test_update_from_subrepos(tmp_dir, dvc, erepo_dir, is_dvc):
      subrepo = erepo_dir / "subrepo"
      make_subrepo(subrepo, erepo_dir.scm)
      gen = subrepo.dvc_gen if is_dvc else subrepo.scm_gen
      with subrepo.chdir():
          gen("foo", "foo", commit="subrepo initial")
  
      path = os.path.join("subrepo", "foo")
      repo_path = os.fspath(erepo_dir)
      dvc.imp(repo_path, path, out="out")
      assert dvc.status() == {}
  
      with subrepo.chdir():
          gen("foo", "foobar", commit="subrepo second commit")
  
      assert dvc.status()["out.dvc"][0]["changed deps"] == {
          f"{path} ({repo_path})": "update available"
      }
      (stage,) = dvc.update(["out.dvc"])
  
      assert (tmp_dir / "out").read_text() == "foobar"
      assert stage.deps[0].def_path == os.path.join("subrepo", "foo")
      assert stage.deps[0].def_repo == {
          "url": repo_path,
          "rev_lock": erepo_dir.scm.get_rev(),
      }
  
imports: import os
  import pytest
  from dvc.dependency import base
  from dvc.dvcfile import load_file
  from dvc.exceptions import InvalidArgumentError
  from dvc.testing.tmp_dir import make_subrepo
label_desc: Use image node_id 11 for calling a global function with example usage: test_update_from_subrepos(tmp_dir, dvc, erepo_dir, is_dvc) without return types