code: def test_something(path=None, new_home=None):
      ds = Dataset(opj(path, "ds")).create(force=True)
      ds.save()
  
      # catches unsupported argument combinations
      assert_raises(
          ValueError, ds.configuration, "dump", scope="branch"
      )
      assert_raises(
          ValueError, ds.configuration, "set", spec=("onlyname",)
      )
      assert_raises(
          ValueError, ds.configuration, "set", spec="nosection=value"
      )
      # we also get that from the internal helper
      from datalad.local.configuration import configuration as cfghelper
  
      assert_in_results(
          cfghelper("set", "global", [("nosection", "value")], {}),
          status="error",
      )
      assert_raises(ValueError, ds.configuration, "invalid")
      res = ds.configuration(result_renderer="disabled")
  
      assert_in_results(
          res, name="something.user.name", value="Jane Doe"
      )
      # UTF handling
      assert_in_results(
          res,
          name="onemore.{}.findme".format(complicated_str),
          value="5.0",
      )
  
      res = ds.configuration(
          "set",
          spec="some.more=test",
          result_renderer="disabled",
      )
      assert_in_results(res, name="some.more", value="test")
      # Python tuple specs
      # swallow outputs to be able to exercise the result renderer
      with swallow_outputs():
          res = ds.configuration(
              "set",
              spec=[
                  ("some.more.still", "test2"),
                  # value is non-str -- will be converted
                  ("lonely.val", 4),
              ],
          )
      assert_in_results(res, name="some.more.still", value="test2")
      assert_in_results(res, name="lonely.val", value="4")
  
      assert_in_results(
          ds.configuration("get", spec="lonely.val"),
          status="ok",
          name="lonely.val",
          value="4",
      )
  
      # remove something that does not exist in the specified scope
      assert_in_results(
          ds.configuration(
              "unset",
              scope="branch",
              spec="lonely.val",
              result_renderer="disabled",
              on_failure="ignore",
          ),
          status="error",
      )
      # remove something that does not exist in the specified scope
      assert_in_results(
          ds.configuration(
              "unset", spec="lonely.val", result_renderer="disabled"
          ),
          status="ok",
      )
      assert_not_in("lonely.val", ds.config)
      # errors if done again
      assert_in_results(
          ds.configuration(
              "unset",
              spec="lonely.val",
              result_renderer="disabled",
              on_failure="ignore",
          ),
          status="error",
      )
  
      # add a subdataset to test recursive operation
      subds = ds.create("subds")
  
      with swallow_outputs():
          res = ds.configuration(
              "set", spec="rec.test=done", recursive=True
          )
      assert_result_count(
          res,
          2,
          name="rec.test",
          value="done",
      )
  
      # exercise the result renderer
      with swallow_outputs() as cml:
          ds.configuration(recursive=True)
          # we get something on the subds with the desired markup
          assert_in("<ds>/subds:rec.test=done", cml.out)
  
imports: from os.path import join
  from packaging.version import Version
  import datalad
  from datalad.distribution.dataset import Dataset
  from datalad.tests.utils_pytest import assert_in, assert_in_results, assert_not_in, assert_raises, assert_result_count, swallow_outputs, with_tempfile, with_tree
label_desc: Use image node_id 1 for calling a global function with example usage: test_something(path, new_home) without return types