code: def create_ds_in_store(
      io,
      base_path,
      dsid,
      obj_version,
      store_version,
      alias=None,
      init_obj_tree=True,
  ):
      """Helper to create a dataset in a RIA store
  
      Note, that this is meant as an internal helper and part of intermediate
      RF'ing. Ultimately should lead to a version option for create-sibling-ria
      in conjunction with a store creation command/option.
  
      Parameters
      ----------
      io: SSHRemoteIO or LocalIO
        Respective execution instance.
        Note: To be replaced by proper command abstraction
      base_path: Path
        root path of the store
      dsid: str
        dataset id
      store_version: str
        layout version of the store (dataset tree)
      obj_version: str
        layout version of the dataset itself (object tree)
      alias: str, optional
        alias for the dataset in the store
      init_obj_tree: bool
        whether or not to create the base directory for an annex objects tree (
        'annex/objects')
      """
  
      # TODO: Note for RF'ing, that this is about setting up a valid target
      #       for the special remote not a replacement for create-sibling-ria.
      #       There's currently no git (bare) repo created.
  
      try:
          # TODO: This is currently store layout version!
          #       Too entangled by current get_layout_locations.
          dsgit_dir, archive_dir, dsobj_dir = get_layout_locations(
              int(store_version), base_path, dsid
          )
      except ValueError as e:
          raise UnknownLayoutVersion(str(e))
  
      if obj_version not in known_versions_objt:
          raise UnknownLayoutVersion(
              "Dataset layout version unknown: {}. "
              "Supported: {}".format(obj_version, known_versions_objt)
          )
  
      _ensure_version(io, dsgit_dir, obj_version)
  
      io.mkdir(archive_dir)
      if init_obj_tree:
          io.mkdir(dsobj_dir)
      if alias:
          alias_dir = base_path / "alias"
          io.mkdir(alias_dir)
          try:
              # go for a relative path to keep the alias links valid
              # when moving a store
              io.symlink(
                  Path("..") / dsgit_dir.relative_to(base_path),
                  alias_dir / alias,
              )
          except FileExistsError:
              lgr.warning(
                  "Alias %r already exists in the RIA store, not adding an "
                  "alias.",
                  alias,
              )
  
file_path: datalad/datalad/customremotes/ria_utils.py
imports: import logging
  from pathlib import Path
label_desc: Use image node_id 5 for calling a global function with example usage: create_ds_in_store(io, base_path, dsid, obj_version, store_version, alias, init_obj_tree) without return types