code: def test_cross_cfgman_update(tmp_path):
      myuniqcfg = "datalad.tester.unique.updatecfg"
      myuniqcfg_value = "some"
      myuniqcfg_value2 = "someother"
      assert myuniqcfg not in dl_cfg
      ds = Dataset(tmp_path)
      assert not ds.is_installed()
      # there is no dataset to write to, it rejects it rightfully
      # it is a bit versatile in its exception behavior
      # https://github.com/datalad/datalad/issues/7300
      with pytest.raises((ValueError, CommandError)):
          ds.config.set(myuniqcfg, myuniqcfg_value, scope="local")
      # but we can write to global scope
      ds.config.set(myuniqcfg, myuniqcfg_value, scope="global")
      # it can retrieve the update immediately, because set(reload=)
      # defaults to True
      assert ds.config.get(myuniqcfg) == myuniqcfg_value
      # given that we modified the global scope, we expect this to
      # be reflected in the global cfgman too
      assert dl_cfg.get(myuniqcfg) == myuniqcfg_value
  
      # now we create a repo
      ds.create(result_renderer="disabled")
      # we had written to global scope, we expect the probe item
      # to stick around, even though the cfgman instance is replaced
      assert ds.config.get(myuniqcfg) == myuniqcfg_value
      # now we replace the value via this new cfgman
      ds.config.set(myuniqcfg, myuniqcfg_value2, scope="global")
      # and again expect the global instance to catch up with it
      assert dl_cfg.get(myuniqcfg) == myuniqcfg_value2
  
imports: import logging
  import os
  from os.path import exists
  from os.path import join
  from unittest.mock import patch
  import pytest
  from datalad import cfg
  from datalad.api import create
  from datalad.cmd import CommandError
  from datalad.config import ConfigManager, _where_to_scope, parse_gitconfig_dump, rewrite_url, write_config_section
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.gitrepo import GitRepo
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, assert_equal, assert_false, assert_in, assert_not_equal, assert_not_in, assert_raises, assert_true, chpwd, ok_file_has_content, with_tempfile, with_testsui, with_tree
  from datalad.utils import Path, get_home_envvars, swallow_logs
label_desc: Use image node_id 19 for calling a global function with example usage: test_cross_cfgman_update(tmp_path) without return types