code: def test_plots_show_overlap(
      tmp_dir, dvc, run_copy_metrics, clear_before_run
  ):
      data_dir = tmp_dir / "data"
      data_dir.mkdir()
  
      (data_dir / "m1_temp.yaml").dump({"a": {"b": {"c": 2, "d": 1}}})
      run_copy_metrics(
          str(data_dir / "m1_temp.yaml"),
          str(data_dir / "m1.yaml"),
          single_stage=False,
          commit="add m1",
          name="cp-m1",
          plots=[str(data_dir / "m1.yaml")],
      )
      with (tmp_dir / "dvc.yaml").modify() as d:
          # trying to make an output overlaps error
          d["stages"]["corrupted-stage"] = {
              "cmd": "mkdir data",
              "outs": ["data"],
          }
  
      # running by clearing and not clearing stuffs
      # so as it works even for optimized cases
      if clear_before_run:
          remove(data_dir)
          remove(dvc.cache.local.path)
  
      dvc._reset()
  
      result = dvc.plots.show(onerror=onerror_collect)
      assert isinstance(
          get_plot(result, "workspace", endkey="error"),
          OverlappingOutputPathsError,
      )
  
imports: import json
  import os
  import pytest
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import OverlappingOutputPathsError
  from dvc.repo import Repo
  from dvc.repo.plots import PlotMetricTypeError, onerror_collect
  from dvc.utils.fs import remove
  from dvc.utils.serialize import EncodingError, YAMLFileCorruptedError, modify_yaml
  from tests.utils.plots import get_plot
label_desc: Use image node_id 8 for calling a global function with example usage: test_plots_show_overlap(tmp_dir, dvc, run_copy_metrics, clear_before_run) without return types