code: def _get_nested_collections(path):
      ds = Dataset(path).create()
      c1 = ds.create(ds.pathobj / "subdir" / "collection1")
      c1s1 = c1.create("sub1")
      c1s2 = c1.create("sub2")
      c2 = ds.create("collection2")
      c2s1 = c2.create("sub1")
      c2s11 = c2s1.create("deepsub1")
      ds.save(recursive=True)
      assert_repo_status(ds.path)
      # return a catalog
      return dict(
          root=ds,
          c1=c1,
          c1s1=c1s1,
          c1s2=c1s2,
          c2=c2,
          c2s1=c2s1,
          c2s11=c2s11,
      )
  
imports: import os
  import pytest
  from datalad.api import Dataset, create, create_sibling_gitlab
  from datalad.tests.utils_pytest import assert_raises, assert_repo_status, assert_result_count, assert_status, eq_, with_tempfile
  from datalad.utils import chpwd
label_desc: Use image node_id 1 for calling a global function with example usage: _get_nested_collections(path) and returns: dict