code: def check_create_initopts_form(form, path=None):
      path = Path(path)
  
      template_dir = path / "templates"
      template_dir.mkdir()
      (template_dir / "foo").write_text("")
  
      forms = {
          "list": [f"--template={template_dir}"],
          "dict": {"template": str(template_dir)},
      }
  
      ds = Dataset(path / "ds")
      ds.create(initopts=forms[form])
      ok_exists(ds.repo.dot_git / "foo")
  
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 21 for calling a global function with example usage: check_create_initopts_form(form, path) without return types