code: def show(
      repo: "Repo",
      targets: Optional[List[str]] = None,
      stages: Optional[List[str]] = None,
      outs_only: bool = False,
      all_branches: bool = False,
      all_tags: bool = False,
      revs: Optional[List[str]] = None,
      all_commits: bool = False,
      hide_workspace: bool = True,
      on_error: str = "return",
  ) -> Dict[str, Result]:
      assert on_error in ("raise", "return", "ignore")
  
      targets = [
          os.path.abspath(target) for target in ensure_list(targets)
      ]
      targets = [repo.dvcfs.from_os_path(target) for target in targets]
  
      res = {}
      for rev in repo.brancher(
          revs=revs,
          all_branches=all_branches,
          all_tags=all_tags,
          all_commits=all_commits,
      ):
          try:
              result = _gather_metrics(
                  repo,
                  targets=targets,
                  stages=stages,
                  outs_only=outs_only,
                  on_error=on_error,
              )
              res[rev] = Result(data=result)
          except Exception as exc:  # noqa: BLE001
              if on_error == "raise":
                  raise
  
              logger.warning(
                  "failed to load metrics in revision %r, %s",
                  rev,
                  str(exc),
              )
              if on_error == "return":
                  res[rev] = Result(error=exc)
  
      if hide_workspace:
          _hide_workspace(repo.scm, res)
      return res
  
imports: import os
  from itertools import chain
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, Optional, Tuple, TypedDict, Union
  from funcy import ldistinct
  from scmrepo.exceptions import SCMError
  from dvc.log import logger
  from dvc.scm import NoSCMError
  from dvc.utils import as_posix, expand_paths
  from dvc.utils.collections import ensure_list
  from dvc.utils.serialize import load_path
label_desc: Use image node_id 10 for calling a global function with example usage: show(repo, targets, stages, outs_only, all_branches, all_tags, revs, all_commits, hide_workspace, on_error) and returns: res