code: def test_get_stages_old_dvcfile(tmp_dir, dvc):
      (stage1,) = tmp_dir.dvc_gen("foo", "foo")
      assert set(dvc.stage.load_all("foo.dvc")) == {stage1}
      assert set(
          dvc.stage.load_all("foo.dvc", name="foo-generate")
      ) == {stage1}
  
      with pytest.raises(StageFileDoesNotExistError):
          dvc.stage.load_all(path=relpath(tmp_dir / ".." / "foo.dvc"))
  
imports: import os
  from operator import itemgetter
  import pytest
  from funcy import raiser
  from dvc.dvcfile import PROJECT_FILE, FileIsGitIgnored
  from dvc.exceptions import NoOutputOrStageError
  from dvc.repo import Repo
  from dvc.stage.exceptions import StageFileDoesNotExistError, StageNameUnspecified, StageNotFound
  from dvc.utils import relpath
  from dvc.utils.fs import remove
  from dvc.utils.strictyaml import YAMLValidationError
label_desc: Use image node_id 19 for calling a global function with example usage: test_get_stages_old_dvcfile(tmp_dir, dvc) without return types