code: def test_run_dump(tmp_dir, dvc, run_head):
      from dvc.dvcfile import load_file
  
      tmp_dir.gen(
          {
              "dir": {
                  "foo": "foo\nfoo",
                  "bar": "bar\nbar",
                  "foobar": "foobar\foobar",
              }
          }
      )
  
      dvc.run(
          cmd="cp foo foo2",
          deps=["foo"],
          name="copy-foo-foo2",
          wdir="dir",
          outs_persist=["foo2"],
          always_changed=True,
      )
      data = load_file(dvc, PROJECT_FILE)._load()[0]
      assert data == {
          "stages": {
              "copy-foo-foo2": {
                  "cmd": "cp foo foo2",
                  "deps": ["foo"],
                  "outs": [{"foo2": {"persist": True}}],
                  "always_changed": True,
                  "wdir": "dir",
              }
          }
      }
  
      run_head(
          "foo",
          "bar",
          "foobar",
          name="head-files",
          outs=["bar-1"],
          outs_persist=["foo-1"],
          metrics_no_cache=["foobar-1"],
          wdir="dir",
      )
      assert load_file(dvc, PROJECT_FILE)._load()[0] == {
          "stages": {
              "head-files": {
                  "cmd": "python {} foo bar foobar".format(
                      (tmp_dir / "head.py").resolve()
                  ),
                  "wdir": "dir",
                  "deps": ["bar", "foo", "foobar"],
                  "outs": ["bar-1", {"foo-1": {"persist": True}}],
                  "metrics": [{"foobar-1": {"cache": False}}],
              },
              **data["stages"],
          }
      }
  
imports: import logging
  import os
  import textwrap
  import uuid
  import pytest
  from funcy import get_in
  from dvc.cli import main
  from dvc.dependency import ParamsDependency
  from dvc.dependency.base import DependencyDoesNotExistError
  from dvc.dvcfile import LOCK_FILE, PROJECT_FILE, load_file
  from dvc.exceptions import ArgumentDuplicationError, CircularDependencyError, CyclicGraphError, InvalidArgumentError, OutputDuplicationError, OverlappingOutputPathsError
  from dvc.stage import PipelineStage
  from dvc.stage.exceptions import DuplicateStageName, InvalidStageName, StagePathNotDirectoryError, StagePathNotFoundError, StagePathOutsideError
  from dvc.utils.serialize import load_yaml
label_desc: Use image node_id 11 for calling a global function with example usage: test_run_dump(tmp_dir, dvc, run_head) without return types