code: def with_store_insteadof(func):
      """decorator to set a (user-) config and clean up afterwards"""
  
      @wraps(func)
      @attr("with_config")
      def _wrap_with_store_insteadof(*args, **kwargs):
          host = args[0]
          base_path = args[1]
          try:
              dl_cfg.set(
                  "url.ria+{prot}://{host}{path}.insteadOf"
                  "".format(
                      prot="ssh" if host else "file",
                      host=host if host else "",
                      path=base_path,
                  ),
                  "ria+ssh://test-store:",
                  scope="global",
                  reload=True,
              )
              return func(*args, **kwargs)
          finally:
              dl_cfg.unset(
                  "url.ria+{prot}://{host}{path}.insteadOf"
                  "".format(
                      prot="ssh" if host else "file",
                      host=host if host else "",
                      path=base_path,
                  ),
                  scope="global",
                  reload=True,
              )
  
      return _wrap_with_store_insteadof
  
file_path: datalad/datalad/distributed/tests/test_create_sibling_ria.py
imports: import logging
  import os.path
  from functools import wraps
  from unittest.mock import patch
  from datalad import cfg
  from datalad.api import Dataset, clone
  from datalad.support.network import get_local_file_url
  from datalad.tests.utils_pytest import assert_false, assert_in, assert_raises, assert_repo_status, assert_result_count, assert_status, attr, chpwd, eq_, known_failure_githubci_win, ok_exists, skip_if_on_windows, skip_ssh, skip_wo_symlink_capability, slow, swallow_logs, with_tempfile, with_tree
  from datalad.utils import Path
label_desc: Use image node_id 1 for calling a global function with example usage: with_store_insteadof(func) and returns: _wrap_with_store_insteadof, func