code: def test_kill(path=None):
      # nested datasets with load
      ds = Dataset(path).create()
      (ds.pathobj / "file.dat").write_text("load")
      ds.save("file.dat")
      subds = ds.create("deep1")
      eq_(sorted(ds.subdatasets(result_xfm="relpaths")), ["deep1"])
      assert_repo_status(ds.path)
  
      # and we fail to remove for many reasons
      # - unpushed commits
      # - a subdataset present
      # - unique annex key
      res = ds.remove(on_failure="ignore")
      assert_result_count(res, 1, status="error", path=ds.path)
      eq_(
          ds.remove(reckless="availability", result_xfm="datasets"),
          [subds, ds],
      )
      nok_(ds.pathobj.exists())
  
file_path: datalad/datalad/local/tests/test_remove.py
imports: import os.path
  from datalad.api import clone, remove
  from datalad.distribution.dataset import Dataset
  from datalad.tests.utils_pytest import assert_in, assert_in_results, assert_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, chpwd, create_tree, eq_, get_deeply_nested_structure, nok_, ok_, with_tempfile, with_tree
label_desc: Use image node_id 8 for calling a global function with example usage: test_kill(path) without return types