code: def test_dvc_pull_pipeline_stages(
      tmp_dir, dvc, run_copy, local_remote
  ):
      (stage0,) = tmp_dir.dvc_gen("foo", "foo")
      stage1 = run_copy("foo", "bar", name="copy-foo-bar")
      stage2 = run_copy("bar", "foobar", name="copy-bar-foobar")
      dvc.push()
  
      outs = ["foo", "bar", "foobar"]
  
      clean(outs, dvc)
      dvc.pull()
      assert all((tmp_dir / file).exists() for file in outs)
  
      for out, stage in zip(outs, [stage0, stage1, stage2]):
          for target in [stage.addressing, out]:
              clean(outs, dvc)
              stats = dvc.pull([target])
              assert stats["fetched"] == 1
              assert stats["added"] == [out]
              assert os.path.exists(out)
              assert not any(
                  os.path.exists(out) for out in set(outs) - {out}
              )
  
      clean(outs, dvc)
      stats = dvc.pull([stage2.addressing], with_deps=True)
      assert len(stats["added"]) == 3
      assert set(stats["added"]) == set(outs)
  
      clean(outs, dvc)
      stats = dvc.pull([os.curdir], recursive=True)
      assert set(stats["added"]) == set(outs)
  
imports: import logging
  import os
  import shutil
  import pytest
  from flaky.flaky_decorator import flaky
  import dvc_data
  from dvc.cli import main
  from dvc.exceptions import CheckoutError
  from dvc.repo.open_repo import clean_repos
  from dvc.stage.exceptions import StageNotFound
  from dvc.testing.remote_tests import TestRemote
  from dvc.utils.fs import remove
  from dvc_data.hashfile.db import HashFileDB
  from dvc_data.hashfile.db.local import LocalHashFileDB
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 13 for calling a global function with example usage: test_dvc_pull_pipeline_stages(tmp_dir, dvc, run_copy, local_remote) without return types