code: def _reobtain(ds, update_fn):
      def wrapped(*args, **kwargs):
          repo = ds.repo
          repo_pathobj = repo.pathobj
  
          lgr.info("Applying updates to %s", ds)
          # get all annexed files that have data present
          lgr.info(
              "Recording file content availability "
              "to re-obtain updated files later on"
          )
          ainfo = repo.get_content_annexinfo(
              init=None, eval_availability=True
          )
          # Recode paths for ds.get() call.
          present_files = [
              str(ds.pathobj / f.relative_to(repo_pathobj))
              for f, st in ainfo.items()
              if st["has_content"]
          ]
  
          yield from update_fn(*args, **kwargs)
  
          present_files = [p for p in present_files if lexists(p)]
          if present_files:
              lgr.info(
                  "Ensuring content availability for %i "
                  "previously available files",
                  len(present_files),
              )
              yield from ds.get(
                  present_files,
                  recursive=False,
                  return_type="generator",
              )
  
      return wrapped
  
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 11 for calling a global function with example usage: _reobtain(ds, update_fn) and returns: wrapped