code: def scm_context(
      method,
      autostage: Optional[bool] = None,
      quiet: Optional[bool] = None,
  ):
      @wraps(method)
      def run(repo: "Repo", *args, **kw):
          with repo.scm_context(autostage=autostage, quiet=quiet):
              return method(repo, *args, **kw)
  
      return run
  
file_path: dvc/dvc/repo/scm_context.py
imports: import logging
  import shlex
  from contextlib import contextmanager
  from functools import wraps
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, List, Optional, Set, Union
  from dvc.log import logger
  from dvc.utils import relpath
  from dvc.utils.collections import ensure_list
label_desc: Use image node_id 1 for calling a global function with example usage: scm_context(method, autostage, quiet) and returns: run, method