code: def _generate_candidate_clone_sources(
      destds: Dataset, srcs: List, cfg: ConfigManager or None
  ) -> List:
      """Convert "raw" clone source specs to candidate URLs
  
      Returns
      -------
      Each item in the list is a dictionary with clone candidate properties.
      At minimum each dictionary contains a 'giturl' property, with a URL
      value suitable for passing to `git-clone`. Other properties are
      provided by `decode_source_spec()` and are documented there.
      """
      # check for configured URL mappings, either in the given config manager
      # or in the one of the destination dataset, which is typically not existent
      # yet and the process config is then used effectively
      srcs = _map_urls(cfg or destds.config, srcs)
  
      # decode all source candidate specifications
      # use a given config or pass None to make it use the process config
      # manager. Theoretically, we could also do
      # `cfg or destds.config` as done above, but some tests patch
      # the process config manager
      candidate_sources = [decode_source_spec(s, cfg=cfg) for s in srcs]
  
      # now expand the candidate sources with additional variants of the decoded
      # giturl, while duplicating the other properties in the additional records
      # for simplicity. The hope is to overcome a few corner cases and be more
      # robust than git clone
      return [
          dict(props, giturl=s)
          for props in candidate_sources
          for s in _get_flexible_source_candidates(props["giturl"])
      ]
  
imports: import logging
  import re
  from os.path import expanduser
  from pathlib import Path
  from typing import Dict, List, Tuple
  from urllib.parse import unquote
  from datalad.cmd import CommandError, GitWitlessRunner, StdOutCapture
  from datalad.config import ConfigManager
  from datalad.distributed.ora_remote import LocalIO, RIARemoteError, SSHRemoteIO
  from datalad.distribution.dataset import Dataset
  from datalad.distribution.utils import _get_flexible_source_candidates
  from datalad.dochelpers import single_or_plural
  from datalad.log import log_progress
  from datalad.runner.exception import CommandError
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CapturedException, DownloadError
  from datalad.support.gitrepo import GitRepo
  from datalad.support.network import RI, SSHRI, URL, DataLadRI, download_url, get_local_file_url, is_url
  from datalad.support.strings import get_replacement_dict
  from datalad.utils import Path, PurePosixPath, ensure_bool, ensure_list, make_tempfile, rmtree
label_desc: Use image node_id 8 for calling a global function with example usage: _generate_candidate_clone_sources(destds, srcs, cfg) and returns: unknown