code: def test_ensure_datalad_remote_maybe_enable(path=None, *, autoenable):
      path = Path(path)
      ds_a = Dataset(path / "a").create(force=True)
      init_datalad_remote(
          ds_a.repo, DATALAD_SPECIAL_REMOTE, autoenable=autoenable
      )
  
      ds_b = clone(source=ds_a.path, path=path / "b")
      repo = ds_b.repo
      if not autoenable:
          assert_not_in("datalad", repo.get_remotes())
      ensure_datalad_remote(repo)
      assert_in("datalad", repo.get_remotes())
  
file_path: datalad/datalad/customremotes/tests/test_base.py
imports: from os.path import isabs
  import pytest
  from datalad.api import Dataset, clone
  from datalad.consts import DATALAD_SPECIAL_REMOTE
  from datalad.support.annexrepo import AnnexRepo
  from datalad.tests.utils_pytest import assert_false, assert_in, assert_not_in, assert_raises, known_failure_githubci_win, with_tempfile, with_tree
  from datalad.utils import Path
  from ..archives import ArchiveAnnexCustomRemote
  from ..base import ensure_datalad_remote, init_datalad_remote
label_desc: Use image node_id 4 for calling a global function with example usage: test_ensure_datalad_remote_maybe_enable(path) without return types