code: def test_saving_prior(topdir=None):
      # the problem is that we might be saving what is actually needed to be
      # "created"
  
      # we would like to place this structure into a hierarchy of two datasets
      # so we create first top one
      ds1 = create(topdir, force=True)
      # and everything is ok, stuff is not added BUT ds1 will be considered dirty
      assert_repo_status(ds1.path, untracked=["ds2"])
      # And then we would like to initiate a sub1 subdataset
      ds2 = create("ds2", dataset=ds1, force=True)
      # But what will happen is file1.txt under ds2 would get committed first into
      # ds1, and then the whole procedure actually crashes since because ds2/file1.txt
      # is committed -- ds2 is already known to git and it just pukes with a bit
      # confusing    'ds2' already exists in the index
      assert_in("ds2", ds1.subdatasets(result_xfm="relpaths"))
  
imports: import os
  import os.path
  import pytest
  from datalad.api import create
  from datalad.cmd import WitlessRunner
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError
  from datalad.tests.utils_pytest import OBSCURE_FILENAME, assert_in, assert_in_results, assert_not_in, assert_raises, assert_repo_status, assert_status, eq_, has_symlink_capability, ok_, ok_exists, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import Path, chpwd
label_desc: Use image node_id 11 for calling a global function with example usage: test_saving_prior(topdir) without return types