code: def _post_gitclone_processing_(
      *,
      destds: Dataset,
      cfg: ConfigManager,
      gitclonerec: Dict,
      reckless: None or str,
      checkout_gitsha: None or str,
      description: None or str,
  ):
      """Perform git-clone post-processing
  
      This is helper is called immediately after a Git clone was established.
  
      The properties of that clone are passed via `gitclonerec`.
  
      Yields
      ------
      DataLad result records
      """
      dest_repo = destds.repo
      remote = _get_remote(dest_repo)
  
      yield from _post_git_init_processing_(
          destds=destds,
          cfg=cfg,
          gitclonerec=gitclonerec,
          remote=remote,
          reckless=reckless,
      )
  
      if knows_annex(destds.path):
          # init annex when traces of a remote annex can be detected
          yield from _pre_annex_init_processing_(
              destds=destds,
              cfg=cfg,
              gitclonerec=gitclonerec,
              remote=remote,
              reckless=reckless,
          )
          dest_repo = _annex_init(
              destds=destds,
              cfg=cfg,
              gitclonerec=gitclonerec,
              remote=remote,
              description=description,
          )
          yield from _post_annex_init_processing_(
              destds=destds,
              cfg=cfg,
              gitclonerec=gitclonerec,
              remote=remote,
              reckless=reckless,
          )
  
      if (
          checkout_gitsha
          and dest_repo.get_hexsha(dest_repo.get_corresponding_branch())
          != checkout_gitsha
      ):
          try:
              postclone_checkout_commit(
                  dest_repo, checkout_gitsha, remote=remote
              )
          except Exception:
              # We were supposed to clone a particular version but failed to.
              # This is particularly pointless in case of subdatasets and
              # potentially fatal with current implementation of recursion.
              # see gh-5387
              lgr.debug(
                  "Failed to checkout %s, removing this clone attempt at %s",
                  checkout_gitsha,
                  destds.path,
              )
              raise
  
      yield from _pre_final_processing_(
          destds=destds,
          cfg=cfg,
          gitclonerec=gitclonerec,
          remote=remote,
          reckless=reckless,
      )
  
imports: import logging
  from argparse import REMAINDER
  from typing import Dict
  from datalad.cmd import CommandError
  from datalad.config import ConfigManager
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod, require_dataset, resolve_path
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.common_opts import location_description, reckless_opt
  from datalad.interface.results import get_status_dict
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.constraints import EnsureKeyChoice, EnsureNone, EnsureStr
  from datalad.support.exceptions import CapturedException
  from datalad.support.network import RI, PathRI
  from datalad.support.param import Parameter
  from datalad.utils import knows_annex, PurePath, rmtree
  from .clone_utils import _check_autoenable_special_remotes, _format_clone_errors, _generate_candidate_clone_sources, _get_remote, _get_tracking_source, _map_urls, _test_existing_clone_target, _try_clone_candidates, decode_source_spec, postclone_preannex_cfg_ria, postclonecfg_ria
label_desc: Use image node_id 2 for calling a global function with example usage: _post_gitclone_processing_() without return types