code: def test_init_sub_dir(tmp_dir):
      Repo.init(os.fspath(tmp_dir))
      subdir = tmp_dir / "dir"
      subdir.mkdir()
  
      scm = SCM(os.fspath(subdir))
      assert scm.root_dir == os.fspath(tmp_dir)
  
file_path: dvc/tests/func/test_scm.py
imports: import os
  import pytest
  from git import Repo
  from dvc.scm import SCM, Git, NoSCM, SCMError, lfs_prefetch
label_desc: Use image node_id 4 for calling a global function with example usage: test_init_sub_dir(tmp_dir) without return types