code: def test_hierarchy(topdir=None):
      # GH 1178
      from datalad.api import create_test_dataset
  
      with swallow_logs(), swallow_outputs():
          dss = create_test_dataset(topdir, spec="1/1")
  
      eq_(len(dss), 3)
      eq_(dss[0], topdir)
      for ids, ds in enumerate(dss):
          assert_repo_status(ds, annex=False)
          # each one should have 2 commits (but the last one)-- one for file and
          # another one for sub-dataset
          repo = repo_from_path(ds)
          if (
              not hasattr(repo, "is_managed_branch")
              or not repo.is_managed_branch()
          ):
              eq_(
                  len(list(repo.get_branch_commits_())),
                  1 + int(ids < 2),
              )
  
file_path: datalad/datalad/distribution/tests/test_create_test_dataset.py
imports: from glob import glob
  from os.path import join
  from datalad.core.local.repo import repo_from_path
  from datalad.distribution.create_test_dataset import _parse_spec
  from datalad.tests.utils_pytest import assert_raises, assert_repo_status, eq_, ok_, with_tempfile
  from datalad.utils import chpwd, swallow_logs, swallow_outputs
label_desc: Use image node_id 6 for calling a global function with example usage: test_hierarchy(topdir) without return types