code: def _save_after_update(
      refds, tosave, update_failures, path_arg, saw_subds
  ):
      if path_arg and not saw_subds:
          lgr.warning(
              "path constraints did not match an installed subdataset: %s",
              path_arg,
          )
      if refds in update_failures:
          lgr.warning(
              "Not saving because top-level dataset %s "
              "had an update failure in subdataset",
              refds.path,
          )
      else:
          save_paths = [p for p in tosave if p != refds.path]
          if not save_paths:
              return
          lgr.debug(
              "Subdatasets where updated state may need to be "
              "saved in the parent dataset: %s",
              save_paths,
          )
          for r in refds.save(
              path=save_paths,
              recursive=False,
              message="[DATALAD] Save updated subdatasets",
              return_type="generator",
              result_renderer="disabled",
          ):
              yield r
  
imports: import logging
  from os.path import lexists
  import itertools
  from datalad.interface.base import Interface
  from datalad.interface.base import build_doc, eval_results
  from datalad.interface.results import get_status_dict, YieldDatasets
  from datalad.support.constraints import EnsureBool, EnsureChoice, EnsureStr, EnsureNone
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CapturedException, CommandError
  from datalad.support.param import Parameter
  from datalad.interface.common_opts import recursion_flag, recursion_limit
  from datalad.distribution.dataset import require_dataset
  from .dataset import EnsureDataset, datasetmethod
label_desc: Use image node_id 2 for calling a global function with example usage: _save_after_update(refds, tosave, update_failures, path_arg, saw_subds) without return types