code: def test_create_subdataset_hierarchy_from_top(path=None):
      # how it would look like to overlay a subdataset hierarchy onto
      # an existing directory tree
      ds = Dataset(op.join(path, "origin")).create(force=True)
      # we got a dataset ....
      ok_(ds.is_installed())
      # ... but it has untracked content
      ok_(ds.repo.dirty)
      subds = ds.create("ds-" + OBSCURE_FILENAME, force=True)
      ok_(subds.is_installed())
      ok_(subds.repo.dirty)
      subsubds = subds.create("subsub", force=True)
      ok_(subsubds.is_installed())
      ok_(subsubds.repo.dirty)
      ok_(ds.id != subds.id != subsubds.id)
      ds.save(updated=True, recursive=True)
      # 'file*' in each repo was untracked before and should remain as such
      # (we don't want a #1419 resurrection
      ok_(ds.repo.dirty)
      ok_(subds.repo.dirty)
      ok_(subsubds.repo.dirty)
      # if we add these three, we should get clean
      ds.save(
          [
              "file1",
              op.join(subds.path, "file2"),
              op.join(subsubds.path, "file3"),
          ]
      )
      assert_repo_status(ds.path)
      ok_(ds.id != subds.id != subsubds.id)
  
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 9 for calling a global function with example usage: test_create_subdataset_hierarchy_from_top(path) without return types