code: def check_reckless(annex, src_path, top_path, sharedpath):
      # super with or without annex
      src = Dataset(src_path).create(annex=annex)
      # sub always with annex
      srcsub = src.create("sub")
  
      # and for the actual test
      ds = clone(
          src.path,
          top_path,
          reckless=True,
          result_xfm="datasets",
          return_type="item-or-list",
      )
  
      is_crippled = srcsub.repo.is_managed_branch()
  
      if annex and not is_crippled:
          eq_(ds.config.get("annex.hardlink", None), "true")
  
      # actual value is 'auto', because True is a legacy value and we map it
      eq_(ds.config.get("datalad.clone.reckless", None), "auto")
      if annex:
          eq_(
              ds.repo.repo_info()["untrusted repositories"][0]["here"],
              True,
          )
      # now, if we clone another repo into this one, it will inherit the setting
      # without having to provide it explicitly
      newsub = ds.clone(
          srcsub,
          "newsub",
          result_xfm="datasets",
          return_type="item-or-list",
      )
      # and `get` the original subdataset
      origsub = ds.get(
          "sub", result_xfm="datasets", return_type="item-or-list"
      )
      for sds in (newsub, origsub):
          eq_(sds.config.get("datalad.clone.reckless", None), "auto")
          if not is_crippled:
              eq_(sds.config.get("annex.hardlink", None), "true")
  
      if is_crippled:
          raise SkipTest(
              "Remainder of test needs proper filesystem permissions"
          )
  
      if annex:
          if ds.repo.git_annex_version < "8.20200908":
              # TODO: Drop when GIT_ANNEX_MIN_VERSION is at least 8.20200908.
  
              # the standard setup keeps the annex locks accessible to the user only
              nok_(
                  (ds.pathobj / ".git" / "annex" / "index.lck")
                  .stat()
                  .st_mode
                  & stat.S_IWGRP
              )
          else:
              # umask might be such (e.g. 002) that group write permissions are inherited, so
              # for the next test we should check if that is the case on some sample file
              dltmp_path = ds.pathobj / ".git" / "dltmp"
              dltmp_path.write_text("")
              default_grp_write_perms = (
                  dltmp_path.stat().st_mode & stat.S_IWGRP
              )
              dltmp_path.unlink()
              # the standard setup keeps the annex locks following umask inheritance
              eq_(
                  (ds.pathobj / ".git" / "annex" / "index.lck")
                  .stat()
                  .st_mode
                  & stat.S_IWGRP,
                  default_grp_write_perms,
              )
  
          # but we can set it up for group-shared access too
          sharedds = clone(
              src,
              sharedpath,
              reckless="shared-group",
              result_xfm="datasets",
              return_type="item-or-list",
          )
          ok_(
              (sharedds.pathobj / ".git" / "annex" / "index.lck")
              .stat()
              .st_mode
              & stat.S_IWGRP
          )
  
imports: import logging
  import os.path
  import stat
  from unittest.mock import patch
  import pytest
  from datalad import consts
  from datalad.api import clone, create, remove
  from datalad.cmd import GitWitlessRunner
  from datalad.cmd import WitlessRunner
  from datalad.config import ConfigManager
  from datalad.core.distributed.clone_utils import _get_installationpath_from_url, decode_source_spec
  from datalad.distribution.dataset import Dataset
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import IncompleteResultsError
  from datalad.support.external_versions import external_versions
  from datalad.support.gitrepo import GitRepo
  from datalad.support.network import get_local_file_url
  from datalad.tests.utils_pytest import DEFAULT_BRANCH, DEFAULT_REMOTE, SkipTest, assert_false, assert_in, assert_in_results, assert_message, assert_not_in, assert_not_is_instance, assert_raises, assert_repo_status, assert_result_count, assert_result_values_equal, assert_status, create_tree, eq_, get_datasets_topdir, has_symlink_capability, integration, known_failure, known_failure_githubci_win, known_failure_osx, known_failure_windows, neq_, nok_, ok_, ok_file_has_content, ok_startswith, on_github, on_osx, on_travis, patch_config, serve_path_via_http, set_date, skip_if, skip_if_adjusted_branch, skip_if_no_network, skip_if_on_windows, skip_ssh, slow, swallow_logs, with_sameas_remote, with_tempfile, with_tree, xfail_buggy_annex_info
  from datalad.utils import Path, chpwd, get_home_envvars, on_windows, rmtree
label_desc: Use image node_id 14 for calling a global function with example usage: check_reckless(annex, src_path, top_path, sharedpath) without return types