code: def _kill_dataset(ds):
      """This is a harsh internal helper: it will wipe out a dataset, no checks"""
      # figure out whether we should be nice to a superdataset later on
      has_super = ds.get_superdataset(
          topmost=False, registered_only=True
      )
      # Close any possibly associated process etc with underlying repo.
      # Otherwise - rmtree could fail to remove e.g. under NFS which would
      # still have some files opened by them (thus having .nfs00000xxxx
      # files) forbidding rmdir to work in rmtree
      ds.close()
      rmtree(ds.path)
      # invalidate loaded ConfigManager -- datasets are singletons!!
      ds._cfg = None
      if has_super:
          # recreate an empty mountpoint to make Git happier
          ds.pathobj.mkdir(exist_ok=True)
      yield dict(
          # keep uninstall to please the gods of a distant past
          # action='drop',
          action="uninstall",
          path=ds.path,
          type="dataset",
          status="ok",
      )
  
imports: import logging
  from itertools import chain
  import warnings
  from datalad.core.local.status import get_paths_by_ds
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod, require_dataset
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.common_opts import jobs_opt, recursion_flag, recursion_limit
  from datalad.interface.results import annexjson2result, results_from_annex_noinfo, success_status_map
  from datalad.runner.exception import CommandError
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.constraints import EnsureChoice, EnsureNone, EnsureStr
  from datalad.support.exceptions import CapturedException
  from datalad.support.param import Parameter
  from datalad.utils import ensure_list, rmtree
label_desc: Use image node_id 7 for calling a global function with example usage: _kill_dataset(ds) without return types