code: def _get_targetpaths(ds, content, refds_path, source, jobs):
      # not ready for Path instances...
      content = [str(c) for c in content]
      # hand over to git-annex, get files content,
      # report files in git as 'notneeded' to get
      ds_repo = ds.repo
      # needs to be an annex to get content
      if not isinstance(ds_repo, AnnexRepo):
          for r in results_from_paths(
              content,
              status="notneeded",
              message="no dataset annex, content already present",
              action="get",
              type="file",
              logger=lgr,
              refds=refds_path,
          ):
              yield r
          return
      respath_by_status = {}
      try:
          results = ds_repo.get(
              content,
              options=["--from=%s" % source] if source else [],
              jobs=jobs,
          )
      except CommandError as exc:
          results = exc.kwargs.get("stdout_json")
          if not results:
              raise
  
      for res in results:
          res = annexjson2result(
              res, ds, type="file", logger=lgr, refds=refds_path
          )
          success = success_status_map[res["status"]]
          # TODO: in case of some failed commands (e.g. get) there might
          # be no path in the record.  yoh has only vague idea of logic
          # here so just checks for having 'path', but according to
          # results_from_annex_noinfo, then it would be assumed that
          # `content` was acquired successfully, which is not the case
          if "path" in res:
              respath_by_status[success] = respath_by_status.get(
                  success, []
              ) + [res["path"]]
          yield res
  
      for r in results_from_annex_noinfo(
          ds,
          content,
          respath_by_status,
          dir_fail_msg="could not get some content in %s %s",
          noinfo_dir_msg="nothing to get from %s",
          noinfo_file_msg="already present",
          action="get",
          logger=lgr,
          refds=refds_path,
      ):
          yield r
  
imports: import logging
  import re
  import os.path
  from datalad.config import ConfigManager
  from datalad.interface.base import Interface, eval_results
  from datalad.interface.base import build_doc
  from datalad.interface.results import get_status_dict, results_from_paths, annexjson2result, success_status_map, results_from_annex_noinfo
  from datalad.interface.common_opts import recursion_flag, location_description, jobs_opt, reckless_opt
  from datalad.interface.results import is_ok_dataset
  from datalad.support.constraints import EnsureInt, EnsureChoice, EnsureStr, EnsureNone
  from datalad.support.collections import ReadOnlyDict
  from datalad.support.param import Parameter
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.gitrepo import GitRepo, _fixup_submodule_dotgit_setup
  from datalad.support.exceptions import CapturedException, CommandError, InsufficientArgumentsError
  from datalad.support.network import URL, RI, urlquote
  from datalad.support.parallel import ProducerConsumerProgressLog
  from datalad.utils import unique, Path, get_dataset_root, shortened_repr
  from datalad.local.subdatasets import Subdatasets
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod, require_dataset
  from datalad.core.distributed.clone import clone_dataset
  from datalad.distribution.utils import _get_flexible_source_candidates
label_desc: Use image node_id 7 for calling a global function with example usage: _get_targetpaths(ds, content, refds_path, source, jobs) without return types