code: def test_from_gitfs_when_pwd_not_in_root(
      tmp_dir, scm, dvc, stage_wdir, cwd, target
  ):
      path = tmp_dir.joinpath(stage_wdir).resolve()
      path.mkdir(parents=True, exist_ok=True)
      wdir = tmp_dir.joinpath(cwd).resolve()
      wdir.mkdir(parents=True, exist_ok=True)
  
      (path / "dvc.yaml").write_text(
          json.dumps(
              {
                  "stages": {
                      "train": {
                          "cmd": "echo foo > foo",
                          "outs": ["foo"],
                      }
                  }
              }
          )
      )
      path.gen({"foo": "foo"})
      dvc.commit(None, force=True)
      tmp_dir.scm_add(
          [
              path / file
              for file in ("dvc.yaml", "dvc.lock", ".gitignore")
          ],
          commit="add files",
      )
  
      with wdir.chdir():
          assert dvc.used_objs([target], revs=[scm.get_rev()])
  
imports: import json
  import os
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_from_gitfs_when_pwd_not_in_root(tmp_dir, scm, dvc, stage_wdir, cwd, target) without return types