code: def test_subsuperdataset_save(path=None):
      # Verify that when invoked without recursion save does not
      # cause querying of subdatasets of the subdataset
      # see https://github.com/datalad/datalad/issues/4523
      parent = Dataset(path).create()
      # Create 3 levels of subdatasets so later to check operation
      # with or without --dataset being specified
      sub1 = parent.create("sub1")
      sub2 = parent.create(sub1.pathobj / "sub2")
      sub3 = parent.create(sub2.pathobj / "sub3")
      assert_repo_status(path)
      # now we will lobotomize that sub3 so git would fail if any query is performed.
      (sub3.pathobj / ".git" / "config").chmod(0o000)
      try:
          sub3.repo.call_git(["ls-files"], read_only=True)
          raise SkipTest
      except CommandError:
          # desired outcome
          pass
      # the call should proceed fine since neither should care about sub3
      # default is no recursion
      parent.save("sub1")
      sub1.save("sub2")
      assert_raises(CommandError, parent.save, "sub1", recursive=True)
      # and should not fail in the top level superdataset
      with chpwd(parent.path):
          save("sub1")
      # or in a subdataset above the problematic one
      with chpwd(sub1.path):
          save("sub2")
  
imports: import itertools
  import logging
  import os
  import os.path
  import pytest
  import datalad.utils
  from datalad.api import create, install, save
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, OBSCURE_FILENAME, SkipTest, assert_in, assert_in_results, assert_not_in, assert_raises, assert_repo_status, assert_result_count, assert_status, chpwd, create_tree, eq_, known_failure, known_failure_windows, maybe_adjust_repo, neq_, ok_, patch, skip_if_adjusted_branch, skip_wo_symlink_capability, swallow_logs, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import Path, ensure_list, rmtree
label_desc: Use image node_id 6 for calling a global function with example usage: test_subsuperdataset_save(path) without return types