code: def test_with_gitignore(tmp_dir, dvc, scm):
      (stage,) = tmp_dir.dvc_gen({"data": {"foo": "foo", "bar": "bar"}})
  
      index = Index.from_repo(dvc)
      assert index.stages == [stage]
  
      scm.ignore(stage.path)
      scm._reset()
  
      index = Index.from_repo(dvc)
      assert not index.stages
  
imports: import os
  from itertools import chain
  import pytest
  from pygtrie import Trie
  from dvc.repo.index import Index
  from dvc.stage import Stage
label_desc: Use image node_id 15 for calling a global function with example usage: test_with_gitignore(tmp_dir, dvc, scm) without return types