docstr: Get the stages related to the given target and collect
  the `info` of its outputs.
  
  This is useful to know what files from the cache are _in use_
  (namely, a file described as an output on a stage).
  
  The scope is, by default, the working directory, but you can use
  `all_branches`/`all_tags`/`all_commits`/`all_experiments` to expand
  the scope.
  
  Returns:
      A dict mapping (remote) ODB instances to sets of objects that
      belong to each ODB. If the ODB instance is None, the objects
      are naive and do not belong to a specific remote ODB.
docstr_tok: ["Get","the","stages","related","to","the","given","target","and","collect","the","`","info","`","of","its","outputs",".","This","is","useful","to","know","what","files","from","the","cache","are","_in","use_","(","namely",",","a","file","described","as","an","output","on","a","stage",")",".","The","scope","is",",","by","default",",","the","working","directory",",","but","you","can","use","`","all_branches","`","\/","`","all_tags","`","\/","`","all_commits","`","\/","`","all_experiments","`","to","expand","the","scope",".","Returns",":","A","dict","mapping","(","remote",")","ODB","instances","to","sets","of","objects","that","belong","to","each","ODB",".","If","the","ODB","instance","is","None",",","the","objects","are","naive","and","do","not","belong","to","a","specific","remote","ODB","."]
code: def used_objs(  # noqa: PLR0913
      self,
      targets=None,
      all_branches=False,
      with_deps=False,
      all_tags=False,
      all_commits=False,
      all_experiments=False,
      commit_date: Optional[str] = None,
      remote=None,
      force=False,
      jobs=None,
      recursive=False,
      used_run_cache=None,
      revs=None,
      num=1,
      push: bool = False,
      skip_failed: bool = False,
  ):
      """Get the stages related to the given target and collect
      the `info` of its outputs.
  
      This is useful to know what files from the cache are _in use_
      (namely, a file described as an output on a stage).
  
      The scope is, by default, the working directory, but you can use
      `all_branches`/`all_tags`/`all_commits`/`all_experiments` to expand
      the scope.
  
      Returns:
          A dict mapping (remote) ODB instances to sets of objects that
          belong to each ODB. If the ODB instance is None, the objects
          are naive and do not belong to a specific remote ODB.
      """
      used = defaultdict(set)
  
      for rev in self.brancher(
          revs=revs,
          all_branches=all_branches,
          all_tags=all_tags,
          all_commits=all_commits,
          all_experiments=all_experiments,
          commit_date=commit_date,
          num=num,
      ):
          try:
              for odb, objs in self.index.used_objs(
                  targets,
                  remote=remote,
                  force=force,
                  jobs=jobs,
                  recursive=recursive,
                  with_deps=with_deps,
                  push=push,
              ).items():
                  used[odb].update(objs)
          except DvcException as exc:
              rev = rev or "workspace"
              if skip_failed:
                  logger.warning(
                      "Failed to collect '%s', skipping", rev
                  )
              else:
                  raise RevCollectionError(rev) from exc
      if used_run_cache:
          for odb, objs in self.stage_cache.get_used_objs(
              used_run_cache, remote=remote, force=force, jobs=jobs
          ).items():
              used[odb].update(objs)
  
      return used
  
imports: import os
  from collections import defaultdict
  from contextlib import contextmanager
  from functools import wraps
  from typing import TYPE_CHECKING, Callable, ContextManager, Iterable, Optional, Tuple, Union
  from dvc.exceptions import DvcException, NotDvcRepoError, OutputNotFoundError, RevCollectionError
  from dvc.ignore import DvcIgnoreFilter
  from dvc.log import logger
  from dvc.utils.objects import cached_property
label_desc: Use image node_id 28 for calling the Repo obj's underlying member method code with example usage: obj.used_objs(targets, all_branches, with_deps, all_tags, all_commits, all_experiments, commit_date, remote, force, jobs, recursive, used_run_cache, revs, num, push, skip_failed) and returns: used