code: def test_overrides():
      cfg = ConfigManager()
      # any sensible (and also our CI) test environment(s) should have this
      assert_in("user.name", cfg)
      # set
      cfg.set("user.name", "myoverride", scope="override")
      assert_equal(cfg["user.name"], "myoverride")
      # unset just removes override, not entire config
      cfg.unset("user.name", scope="override")
      assert_in("user.name", cfg)
      assert_not_equal("user.name", "myoverride")
      # add
      # there is no initial increment
      cfg.add("user.name", "myoverride", scope="override")
      assert_equal(cfg["user.name"], "myoverride")
      # same as with add, not a list
      assert_equal(cfg["user.name"], "myoverride")
      # but then there is
      cfg.add("user.name", "myother", scope="override")
      assert_equal(cfg["user.name"], ["myoverride", "myother"])
      # rename
      assert_not_in("ups.name", cfg)
      cfg.rename_section("user", "ups", scope="override")
      # original variable still there
      assert_in("user.name", cfg)
      # rename of override in effect
      assert_equal(cfg["ups.name"], ["myoverride", "myother"])
      # remove entirely by section
      cfg.remove_section("ups", scope="override")
      from datalad.utils import Path
  
      assert_not_in(
          "ups.name",
          cfg,
          (
              cfg._stores,
              cfg.overrides,
          ),
      )
  
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 8 for calling a global function with example usage: test_overrides() without return types