code: def test_dir_plots(tmp_dir, dvc, run_copy_metrics):
      subdir = tmp_dir / "subdir"
      subdir.mkdir()
  
      metric = [
          {"first_val": 100, "val": 2},
          {"first_val": 200, "val": 3},
      ]
  
      fname = "file.json"
      (tmp_dir / fname).dump_json(metric, sort_keys=True)
  
      p1 = "subdir/p1.json"
      p2 = "subdir/p2.json"
      tmp_dir.dvc.run(
          cmd=(
              f"mkdir subdir && python copy.py {fname} {p1} && "
              f"python copy.py {fname} {p2}"
          ),
          deps=[fname],
          single_stage=False,
          plots=["subdir"],
          name="copy_double",
      )
      props = {"title": "TITLE"}
      dvc.plots.modify("subdir", props)
  
      result = dvc.plots.show()
  
      assert set(get_plot(result, "workspace")) == {p1, p2}
      assert get_plot(
          result, "workspace", typ="definitions", file=""
      ) == {
          p1: props,
          p2: props,
      }
  
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 9 for calling a global function with example usage: test_dir_plots(tmp_dir, dvc, run_copy_metrics) without return types