code: def test_nested_pushclone_cycle_allplatforms(
      origpath=None, storepath=None, clonepath=None
  ):
      if "DATALAD_SEED" in os.environ:
          # we are using create-sibling-ria via the cmdline in here
          # this will create random UUIDs for datasets
          # however, given a fixed seed each call to this command will start
          # with the same RNG seed, hence yield the same UUID on the same
          # machine -- leading to a collision
          raise SkipTest(
              "Test incompatible with fixed random number generator seed"
          )
      # the aim here is this high-level test a std create-push-clone cycle for a
      # dataset with a subdataset, with the goal to ensure that correct branches
      # and commits are tracked, regardless of platform behavior and condition
      # of individual clones. Nothing fancy, just that the defaults behave in
      # sensible ways
      from datalad.cmd import WitlessRunner as Runner
  
      run = Runner().run
  
      # create original nested dataset
      with chpwd(origpath):
          run(["datalad", "create", "super"])
          run(
              [
                  "datalad",
                  "create",
                  "-d",
                  "super",
                  str(Path("super", "sub")),
              ]
          )
  
      # verify essential linkage properties
      orig_super = Dataset(Path(origpath, "super"))
      orig_sub = Dataset(orig_super.pathobj / "sub")
  
      (orig_super.pathobj / "file1.txt").write_text("some1")
      (orig_sub.pathobj / "file2.txt").write_text("some1")
      with chpwd(orig_super.path):
          run(["datalad", "save", "--recursive"])
  
      # TODO not yet reported clean with adjusted branches
      # assert_repo_status(orig_super.path)
  
      # the "true" branch that sub is on, and the gitsha of the HEAD commit of it
      orig_sub_corr_branch = (
          orig_sub.repo.get_corresponding_branch()
          or orig_sub.repo.get_active_branch()
      )
      orig_sub_corr_commit = orig_sub.repo.get_hexsha(
          orig_sub_corr_branch
      )
  
      # make sure the super trackes this commit
      assert_in_results(
          orig_super.subdatasets(),
          path=orig_sub.path,
          gitshasum=orig_sub_corr_commit,
          # TODO it should also track the branch name
          # Attempted: https://github.com/datalad/datalad/pull/3817
          # But reverted: https://github.com/datalad/datalad/pull/4375
      )
  
      # publish to a store, to get into a platform-agnostic state
      # (i.e. no impact of an annex-init of any kind)
      store_url = "ria+" + get_local_file_url(storepath)
      with chpwd(orig_super.path):
          run(
              [
                  "datalad",
                  "create-sibling-ria",
                  "--recursive",
                  "-s",
                  "store",
                  store_url,
                  "--new-store-ok",
              ]
          )
          run(["datalad", "push", "--recursive", "--to", "store"])
  
      # we are using the 'store' sibling's URL, which should be a plain path
      store_super = AnnexRepo(
          orig_super.siblings(name="store")[0]["url"], init=False
      )
      store_sub = AnnexRepo(
          orig_sub.siblings(name="store")[0]["url"], init=False
      )
  
      # both datasets in the store only carry the real branches, and nothing
      # adjusted
      for r in (store_super, store_sub):
          eq_(
              set(r.get_branches()),
              set([orig_sub_corr_branch, "git-annex"]),
          )
  
      # and reobtain from a store
      cloneurl = "ria+" + get_local_file_url(
          str(storepath), compatibility="git"
      )
      with chpwd(clonepath):
          run(
              [
                  "datalad",
                  "clone",
                  cloneurl + "#" + orig_super.id,
                  "super",
              ]
          )
          run(["datalad", "-C", "super", "get", "--recursive", "."])
  
      # verify that nothing has changed as a result of a push/clone cycle
      clone_super = Dataset(Path(clonepath, "super"))
      clone_sub = Dataset(clone_super.pathobj / "sub")
      assert_in_results(
          clone_super.subdatasets(),
          path=clone_sub.path,
          gitshasum=orig_sub_corr_commit,
      )
  
      for ds1, ds2, f in (
          (orig_super, clone_super, "file1.txt"),
          (orig_sub, clone_sub, "file2.txt"),
      ):
          eq_(
              (ds1.pathobj / f).read_text(),
              (ds2.pathobj / f).read_text(),
          )
  
      # get status info that does not recursive into subdatasets, i.e. not
      # looking for uncommitted changes
      # we should see no modification reported
      assert_not_in_results(
          clone_super.status(eval_subdataset_state="commit"),
          state="modified",
      )
      # and now the same for a more expensive full status
      assert_not_in_results(
          clone_super.status(recursive=True), state="modified"
      )
  
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 20 for calling a global function with example usage: test_nested_pushclone_cycle_allplatforms(origpath, storepath, clonepath) without return types