code: def map_scm_exception(with_cause: bool = False) -> Iterator[None]:
      from scmrepo.exceptions import SCMError as InternalSCMError
  
      try:
          yield
      except InternalSCMError as exc:
          into = SCMError(str(exc))
          if with_cause:
              raise into from exc
          raise into
  
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 1 for calling a global function with example usage: map_scm_exception(with_cause) without return types