code: def check_create_path_semantics(
      cwd, create_ds, path_arg, base_path, other_path
  ):
      ds = Dataset(base_path).create()
      os.makedirs(op.join(ds.path, "some"))
      target_path = ds.pathobj / "some" / "what" / "deeper"
      with chpwd(
          other_path
          if cwd == "elsewhere"
          else base_path
          if cwd == "parentds"
          else str(ds.pathobj / "some")
          if cwd == "subdir"
          else str(Path.cwd())
      ):
          subds = create(
              dataset=ds.path
              if create_ds == "abspath"
              else str(ds.pathobj.relative_to(cwd))
              if create_ds == "relpath"
              else ds
              if create_ds == "instance"
              else create_ds,
              path=str(target_path)
              if path_arg == "abspath"
              else str(target_path.relative_to(ds.pathobj))
              if path_arg == "relpath"
              else op.join("what", "deeper")
              if path_arg == "subdir_relpath"
              else path_arg,
          )
          eq_(subds.pathobj, target_path)
  
imports: import os
  import os.path
  import pytest
  from datalad.api import create
  from datalad.cmd import WitlessRunner
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError
  from datalad.tests.utils_pytest import OBSCURE_FILENAME, assert_in, assert_in_results, assert_not_in, assert_raises, assert_repo_status, assert_status, eq_, has_symlink_capability, ok_, ok_exists, swallow_outputs, with_tempfile, with_tree
  from datalad.utils import Path, chpwd
label_desc: Use image node_id 18 for calling a global function with example usage: check_create_path_semantics(cwd, create_ds, path_arg, base_path, other_path) without return types