code: def test_metrics_diff_dirty(tmp_dir, scm, dvc, run_copy_metrics):
      def _gen(val):
          tmp_dir.gen({"m_temp.yaml": str(val)})
          run_copy_metrics(
              "m_temp.yaml",
              "m.yaml",
              name="copy-metrics",
              metrics=["m.yaml"],
          )
          dvc.scm.commit(str(val))
  
      _gen(1)
      _gen(2)
      _gen(3)
  
      tmp_dir.gen({"m.yaml": "4"})
  
      expected = {"m.yaml": {"": {"old": 3, "new": 4, "diff": 1}}}
  
      assert dvc.metrics.diff() == {"diff": expected}
  
imports: import json
  from os.path import join
  import pytest
  from dvc.cli import main
  from dvc.utils import relpath
  from dvc.utils.serialize import JSONFileCorruptedError
label_desc: Use image node_id 11 for calling a global function with example usage: test_metrics_diff_dirty(tmp_dir, scm, dvc, run_copy_metrics) without return types