code: def test_metrics_diff_broken_json(
      M, tmp_dir, scm, dvc, run_copy_metrics
  ):
      metrics = {"a": {"b": {"c": 1, "d": 1, "e": "3"}}}
      (tmp_dir / "m_temp.json").dump(metrics)
      run_copy_metrics(
          "m_temp.json",
          "m.json",
          name="copy-metrics",
          metrics_no_cache=["m.json"],
          commit="add metrics",
      )
  
      (tmp_dir / "m.json").write_text(
          json.dumps(metrics) + "ma\nlformed\n"
      )
  
      assert dvc.metrics.diff() == {
          "diff": {
              "m.json": {
                  "a.b.e": {"old": "3", "new": None},
                  "a.b.c": {"old": 1, "new": None},
                  "a.b.d": {"old": 1, "new": None},
              }
          },
          "errors": {
              "workspace": {
                  "m.json": M.instance_of(JSONFileCorruptedError)
              }
          },
      }
  
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 5 for calling a global function with example usage: test_metrics_diff_broken_json(M, tmp_dir, scm, dvc, run_copy_metrics) without return types