code: def scm_context(request, mocker):
      spec = Git if getattr(request, "param", "scm") == "scm" else NoSCM
      # we'll test `ignore` and `ignore_remove` in a functional test.
      return SCMContext(
          scm=mocker.MagicMock(
              spec=spec,
              **{
                  "ignore_remove.return_value": ".gitignore",
                  "ignore.return_value": ".gitignore",
              },
          )
      )
  
file_path: dvc/tests/unit/repo/test_scm_context.py
imports: import re
  import pytest
  from dvc.repo.scm_context import SCMContext
  from dvc.scm import Git, NoSCM
label_desc: Use image node_id 2 for calling a global function with example usage: scm_context(request, mocker) and returns: SCMContext