code: def _fatal_pre_drop_checks(ds, repo, paths, what, reckless, is_annex):
      if (
          what == "allkeys"
          and paths is not None
          and paths != [ds.pathobj]
      ):
          yield dict(
              action="drop",
              path=ds.path,
              type="dataset",
              status="impossible",
              message=(
                  "cannot drop %s, with path constraints given: %s",
                  what,
                  paths,
              ),
          )
          return
  
      if what in ("all", "datasets") and not reckless == "kill":
          # we must not have subdatasets anymore
          # if we do, --recursive was forgotten
          subdatasets = ds.subdatasets(
              path=paths,
              # we only care about the present ones
              state="present",
              # first-level is enough, if that has none, there will be none
              recursive=False,
              result_xfm="paths",
              result_renderer="disabled",
          )
          if subdatasets:
              yield dict(
                  action="uninstall",
                  path=ds.path,
                  type="dataset",
                  status="error",
                  message=(
                      "cannot drop dataset, subdataset(s) still present "
                      "(forgot --recursive?): %s",
                      subdatasets,
                  ),
              )
              # this is fatal
              return
  
      if (
          what in ("all", "datasets")
          and reckless not in ("availability", "kill")
          and (paths is None or paths == [ds.pathobj])
      ):
          unpushed = _detect_unpushed_revs(repo, is_annex)
          if unpushed:
              yield dict(
                  action="uninstall",
                  path=ds.path,
                  type="dataset",
                  status="error",
                  message=(
                      "to-be-dropped dataset has revisions that "
                      "are not available at any known sibling. Use "
                      "`datalad push --to ...` to push "
                      "these before dropping the local dataset, "
                      "or ignore via `--reckless availability`. "
                      "Unique revisions: %s",
                      unpushed,
                  ),
              )
              # this is fatal
              return
  
      if (
          is_annex
          and what in ("all", "datasets")
          and reckless not in ("undead", "kill")
      ):
          # this annex is about to die, test if it is still considered
          # not-dead. if so, complain to avoid generation of zombies
          # (annexed that are floating around, but are actually dead).
          # if repo.uuid is None, git annex init never ran, and we can skip this
          remotes_that_know_this_annex = (
              None
              if repo.uuid is None
              else [
                  r
                  for r in _detect_nondead_annex_at_remotes(
                      repo, repo.uuid
                  )
                  # filter out "here"
                  if r is not None
              ]
          )
          if remotes_that_know_this_annex:
              yield dict(
                  action="uninstall",
                  path=ds.path,
                  type="dataset",
                  status="error",
                  message=(
                      "to-be-deleted local annex not declared 'dead' at the "
                      "following siblings. Announce death "
                      "(`git annex dead here` + `datalad push --to ...`), "
                      "or ignore via `--reckless undead`: %s",
                      remotes_that_know_this_annex,
                  ),
              )
              # this is fatal
              return
  
      if reckless not in ("modification", "kill"):
          # do a cheaper status run to discover any kind of modification and
          # generate results based on the `what` mode of operation
          for res in ds.status(
              path=paths,
              # untracked content will not be reported on further down
              # must catch it here
              untracked="normal",
              # downstream code can handle non-annex/annex distinction
              # avoid expensive evaluation here
              annex=False,
              # we only need to inspect a subdataset's state in case
              # we want to drop it completely
              eval_subdataset_state="commit"
              if what in ("all", "datasets")
              else "no",
              # recursion is handled outside this function
              recursive=False,
              result_renderer="disabled",
              return_type="generator",
              on_failure="ignore",
          ):
              state = res.get("state")
              if state == "clean":
                  # nothing to worry about, nothing to communicate
                  continue
              elif state in ("modified", "untracked"):
                  yield dict(
                      res,
                      status="impossible",
                      action="drop",
                      message=f"cannot drop {state} content, save first",
                  )
                  # we are not aborting nevetheless. in normal conditions
                  # the above result will stop processing, but if desired
                  # we could go on
              else:
                  lgr.debug(
                      "Status record not considered for drop "
                      "state inspection: %s",
                      res,
                  )
  
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 3 for calling a global function with example usage: _fatal_pre_drop_checks(ds, repo, paths, what, reckless, is_annex) without return types