code: def results_from_annex_noinfo(
      ds: Dataset,
      requested_paths: list[str],
      respath_by_status: dict[str, list[str]],
      dir_fail_msg: str,
      noinfo_dir_msg: str,
      noinfo_file_msg: str,
      noinfo_status: str = "notneeded",
      **kwargs: Any,
  ) -> Iterator[dict[str, Any]]:
      """Helper to yield results based on what information git annex did no give us.
  
      The helper assumes that the annex command returned without an error code,
      and interprets which of the requested paths we have heard nothing about,
      and assumes that git annex was happy with their current state.
  
      Parameters
      ==========
      ds : Dataset
        All results have to be concerning this single dataset (used to resolve
        relpaths).
      requested_paths : list
        List of path arguments sent to `git annex`
      respath_by_status : dict
        Mapping of 'success' or 'failure' labels to lists of result paths
        reported by `git annex`. Everything that is not in here, we assume
        that `git annex` was happy about.
      dir_fail_msg : str
        Message template to inject into the result for a requested directory where
        a failure was reported for some of its content. The template contains two
        string placeholders that will be expanded with 1) the path of the
        directory, and 2) the content failure paths for that directory
      noinfo_dir_msg : str
        Message template to inject into the result for a requested directory that
        `git annex` was silent about (incl. any content). There must be one string
        placeholder that is expanded with the path of that directory.
      noinfo_file_msg : str
        Message to inject into the result for a requested file that `git
        annex` was silent about.
      noinfo_status : str
        Status to report when annex provides no information
      **kwargs
        Any further kwargs are included in the yielded result dictionary.
      """
      for p in requested_paths:
          # any relpath is relative to the currently processed dataset
          # not the global reference dataset
          p = p if isabs(p) else normpath(opj(ds.path, p))
          if any(p in ps for ps in respath_by_status.values()):
              # we have a report for this path already
              continue
          common_report = dict(path=p, **kwargs)
          if isdir(p):
              # `annex` itself will not report on directories, but if a
              # directory was requested, we want to say something about
              # it in the results.  we are inside a single, existing
              # repo, hence all directories are already present, if not
              # we had an error
              # do we have any failures in a subdir of the requested dir?
              failure_results = [
                  fp
                  for fp in respath_by_status.get("failure", [])
                  if path_is_subpath(fp, p)
              ]
              if failure_results:
                  # we were not able to process all requested_paths, let's label
                  # this 'impossible' to get a warning-type report
                  # after all we have the directory itself, but not
                  # (some) of its requested_paths
                  yield get_status_dict(
                      status="impossible",
                      type="directory",
                      message=(dir_fail_msg, p, failure_results),
                      **common_report,
                  )
              else:
                  # otherwise cool, but how cool?
                  success_results = [
                      fp
                      for fp in respath_by_status.get("success", [])
                      if path_is_subpath(fp, p)
                  ]
                  yield get_status_dict(
                      status="ok" if success_results else noinfo_status,
                      message=None
                      if success_results
                      else (noinfo_dir_msg, p),
                      type="directory",
                      **common_report,
                  )
              continue
          else:
              # not a directory, and we have had no word from `git annex`,
              # yet no exception, hence the file was most probably
              # already in the desired state
              yield get_status_dict(
                  status=noinfo_status,
                  type="file",
                  message=noinfo_file_msg,
                  **common_report,
              )
  
imports: from __future__ import annotations
  import logging
  from collections.abc import Iterable, Iterator
  from os.path import isabs, isdir
  from os.path import join
  from os.path import normpath, relpath
  from typing import Any, Optional
  from datalad.distribution.dataset import Dataset
  from datalad.support.exceptions import CapturedException, CommandError, format_oneline_tb
  from datalad.support.path import robust_abspath
  from datalad.utils import PurePosixPath, ensure_list, path_is_subpath
label_desc: Use image node_id 8 for calling a global function with example usage: results_from_annex_noinfo(ds, requested_paths, respath_by_status, dir_fail_msg, noinfo_dir_msg, noinfo_file_msg, noinfo_status) without return types