code: def _test_setup_ds_in_store(io_cls, io_args, store=None):
      io = io_cls(*io_args)
      store = Path(store)
      # ATM create_ds_in_store doesn't care what kind of ID is provided
      dsid = "abc123456"
  
      ds_path = store / dsid[:3] / dsid[3:]  # store layout version 1
      version_file = ds_path / "ria-layout-version"
      archives = ds_path / "archives"
      objects = ds_path / "annex" / "objects"
      git_config = ds_path / "config"
  
      # invalid store version:
      assert_raises(
          UnknownLayoutVersion,
          create_ds_in_store,
          io,
          store,
          dsid,
          "1",
          "abc",
      )
  
      # invalid obj version:
      assert_raises(
          UnknownLayoutVersion,
          create_ds_in_store,
          io,
          store,
          dsid,
          "abc",
          "1",
      )
  
      # version 1
      create_store(io, store, "1")
      create_ds_in_store(io, store, dsid, "1", "1")
      for p in [ds_path, archives, objects]:
          assert_true(p.is_dir(), msg="Not a directory: %s" % str(p))
      for p in [version_file]:
          assert_true(p.is_file(), msg="Not a file: %s" % str(p))
      assert_equal(version_file.read_text(), "1\n")
  
      # conflicting version exists at target:
      assert_raises(
          ValueError, create_ds_in_store, io, store, dsid, "2", "1"
      )
  
      # version 2
      # Note: The only difference between version 1 and 2 are supposed to be the
      #       key paths (dirhashlower vs mixed), which has nothing to do with
      #       setup routine.
      rmtree(str(store))
      create_store(io, store, "1")
      create_ds_in_store(io, store, dsid, "2", "1")
      for p in [ds_path, archives, objects]:
          assert_true(p.is_dir(), msg="Not a directory: %s" % str(p))
      for p in [version_file]:
          assert_true(p.is_file(), msg="Not a file: %s" % str(p))
      assert_equal(version_file.read_text(), "2\n")
  
file_path: datalad/datalad/customremotes/tests/test_ria_utils.py
imports: import tempfile
  from os.path import join
  from urllib.parse import quote
  from datalad.customremotes import ria_utils
  from datalad.customremotes.ria_utils import UnknownLayoutVersion, create_ds_in_store, create_store, verify_ria_url
  from datalad.distributed.ora_remote import LocalIO, SSHRemoteIO
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_raises, assert_true, rmtree, skip_ssh, with_tempfile
  from datalad.utils import Path, on_windows
label_desc: Use image node_id 3 for calling a global function with example usage: _test_setup_ds_in_store(io_cls, io_args, store) without return types