code: def test_show_subrepo_with_preexisting_tags(tmp_dir, scm):
      tmp_dir.gen("foo", "foo")
      scm.add("foo")
      scm.commit("init")
      scm.tag("no-metrics")
  
      tmp_dir.gen({"subdir": {}})
      subrepo_dir = tmp_dir / "subdir"
      with subrepo_dir.chdir():
          dvc = Repo.init(subdir=True)
          scm.commit("init dvc")
  
          dvc.run(
              cmd="echo foo: 1 > metrics.yaml",
              metrics=["metrics.yaml"],
              name="generate-metrics",
          )
  
      scm.add(
          [
              str(subrepo_dir / "metrics.yaml"),
              str(subrepo_dir / "dvc.yaml"),
              str(subrepo_dir / "dvc.lock"),
          ]
      )
      scm.commit("init metrics")
      scm.tag("v1")
  
      expected_path = "metrics.yaml"
      assert dvc.metrics.show(all_tags=True) == {
          "workspace": {"data": {expected_path: {"data": {"foo": 1}}}},
          "v1": {"data": {expected_path: {"data": {"foo": 1}}}},
      }
  
imports: import json
  import os
  from os.path import join
  import pytest
  from funcy import get_in
  from dvc.cli import main
  from dvc.dvcfile import PROJECT_FILE
  from dvc.exceptions import OverlappingOutputPathsError
  from dvc.repo import Repo
  from dvc.utils.fs import remove
  from dvc.utils.serialize import JSONFileCorruptedError
label_desc: Use image node_id 8 for calling a global function with example usage: test_show_subrepo_with_preexisting_tags(tmp_dir, scm) without return types