code: def test_force_checkdatapresent(srcpath=None, dstpath=None):
      src = Dataset(srcpath).create()
      target = mk_push_target(
          src, "target", dstpath, annex=True, bare=True
      )
      (src.pathobj / "test_mod_annex_file").write_text("Heavy stuff.")
      src.save(to_git=False, message="New annex file")
      assert_repo_status(src.path, annex=True)
      whereis_prior = src.repo.whereis(files=["test_mod_annex_file"])[0]
  
      res = src.push(to="target", data="nothing")
      # nothing reported to be copied
      assert_not_in_results(res, action="copy")
      # we got the git-push nevertheless
      eq_(
          src.repo.get_hexsha(DEFAULT_BRANCH),
          target.get_hexsha(DEFAULT_BRANCH),
      )
      # nothing moved
      eq_(
          whereis_prior,
          src.repo.whereis(files=["test_mod_annex_file"])[0],
      )
  
      # now a push without forced no-transfer
      # we do not give since, so the non-transfered file is picked up
      # and transferred
      annex_branch_state = src.repo.get_hexsha("git-annex")
      res = src.push(to="target", force=None)
      # no branch change, done before
      assert_in_results(
          res,
          action="publish",
          status="notneeded",
          refspec=DEFAULT_REFSPEC,
      )
      # but availability update
      # reflected as a change in git-annex branch
      assert annex_branch_state != src.repo.get_hexsha("git-annex")
      # and identical state here and on the remote
      assert src.repo.get_hexsha("git-annex") == src.repo.get_hexsha(
          "target/git-annex"
      )
  
      # as a result of [10.20231129-84-geb59da9dd2](https://git.kitenet.net/index.cgi/git-annex.git/commit/?id=HEAD)
      # which makes git-annex clocks less precise, the git-annex branch change on the remote as a result of
      # `annex copy` has exactly the same content and timestamp in git-annex branch, so the same commit as local,
      # so when we fetch updates from the remote, we end up on the same commit instead of merging
      # updated availability with difference in timestamp within git-annex branch of minuscule difference
      try:
          assert_in_results(
              res,
              action="publish",
              status="notneeded",
              refspec="refs/heads/git-annex:refs/heads/git-annex",
          )
      except AssertionError:
          # before then -- we would report that update was pushed since update had a
          # slightly different git-annex timestamp locally from the remote, and thus commits
          # were different
          if external_versions["cmd:annex"] < "10.20231212":
              assert_in_results(
                  res,
                  action="publish",
                  status="ok",
                  refspec="refs/heads/git-annex:refs/heads/git-annex",
              )
          else:
              raise
  
      assert_in_results(
          res,
          status="ok",
          path=str(src.pathobj / "test_mod_annex_file"),
          action="copy",
      )
      # whereis info reflects the change
      ok_(
          len(whereis_prior)
          < len(src.repo.whereis(files=["test_mod_annex_file"])[0])
      )
  
      # do it yet again will do nothing, because all is up-to-date
      assert_status("notneeded", src.push(to="target", force=None))
      # an explicit reference point doesn't change that
      assert_status(
          "notneeded", src.push(to="target", force=None, since="HEAD~1")
      )
  
      # now force data transfer
      res = src.push(to="target", force="checkdatapresent")
      # no branch change, done before
      assert_in_results(
          res,
          action="publish",
          status="notneeded",
          refspec=DEFAULT_REFSPEC,
      )
      # no availability update
      assert_in_results(
          res,
          action="publish",
          status="notneeded",
          refspec="refs/heads/git-annex:refs/heads/git-annex",
      )
      # but data transfer
      assert_in_results(
          res,
          status="ok",
          path=str(src.pathobj / "test_mod_annex_file"),
          action="copy",
      )
  
      # force data transfer, but data isn't available
      src.repo.drop("test_mod_annex_file")
      res = src.push(
          to="target",
          path=".",
          force="checkdatapresent",
          on_failure="ignore",
      )
      assert_in_results(
          res,
          status="impossible",
          path=str(src.pathobj / "test_mod_annex_file"),
          action="copy",
          message="Slated for transport, but no content present",
      )
  
imports: import logging
  import os
  import pytest
  from datalad.core.distributed.clone import Clone
  from datalad.core.distributed.push import Push
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import IncompleteResultsError, InsufficientArgumentsError
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.support.network import get_local_file_url
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_not_in, assert_not_in_results, assert_raises, assert_repo_status, assert_result_count, assert_status, eq_, known_failure_githubci_osx, known_failure_githubci_win, neq_, ok_, ok_file_has_content, serve_path_via_http, skip_if_adjusted_branch, skip_if_on_windows, skip_ssh, slow, swallow_logs, with_tempfile, with_tree
  from datalad.utils import Path, chpwd, path_startswith, swallow_outputs
label_desc: Use image node_id 8 for calling a global function with example usage: test_force_checkdatapresent(srcpath, dstpath) without return types