code: def iter_revs(
      scm: "Git",
      revs: Optional[List[str]] = None,
      num: int = 1,
      all_branches: bool = False,
      all_tags: bool = False,
      all_commits: bool = False,
      all_experiments: bool = False,
      commit_date: Optional[str] = None,
  ) -> Mapping[str, List[str]]:
      from scmrepo.exceptions import SCMError as _SCMError
  
      from dvc.repo.experiments.utils import exp_commits
  
      if not any(
          [
              revs,
              all_branches,
              all_tags,
              all_commits,
              all_experiments,
              commit_date,
          ]
      ):
          return {}
  
      revs = revs or []
      results: List[str] = _get_n_commits(scm, revs, num)
  
      if all_commits:
          results.extend(scm.list_all_commits())
      else:
          if all_branches:
              results.extend(scm.list_branches())
  
          if all_tags:
              results.extend(scm.list_tags())
  
          if commit_date:
              from datetime import datetime
  
              commit_datestamp = datetime.strptime(
                  commit_date, "%Y-%m-%d"
              ).timestamp()
  
              def _time_filter(rev):
                  try:
                      return (
                          scm.resolve_commit(rev).commit_time
                          >= commit_datestamp
                      )
                  except _SCMError:
                      return True
  
              results.extend(
                  filter(_time_filter, scm.list_all_commits())
              )
  
      if all_experiments:
          results.extend(exp_commits(scm))
  
      rev_resolver = partial(resolve_rev, scm)
      return group_by(rev_resolver, results)
  
imports: import os
  from contextlib import contextmanager
  from functools import partial
  from typing import TYPE_CHECKING, Iterator, List, Literal, Mapping, Optional, Union, overload
  from funcy import group_by
  from scmrepo.base import Base
  from scmrepo.git import Git
  from scmrepo.noscm import NoSCM
  from dvc.exceptions import DvcException
  from dvc.progress import Tqdm
label_desc: Use image node_id 9 for calling a global function with example usage: iter_revs(scm, revs, num, all_branches, all_tags, all_commits, all_experiments, commit_date) and returns: group_by, dict, unknown, True