code: def diff_revision(dataset, revision="HEAD"):
      """Yield files that have been added or modified in `revision`.
  
      Parameters
      ----------
      dataset : Dataset
      revision : string, optional
          Commit-ish of interest.
  
      Returns
      -------
      Generator that yields AnnotatePaths instances
      """
      if dataset.repo.commit_exists(revision + "^"):
          fr = revision + "^"
      else:
          # No other commits are reachable from this revision.  Diff
          # with an empty tree instead.
          fr = PRE_INIT_COMMIT_SHA
  
      def changed(res):
          return (
              res.get("action") == "diff"
              and res.get("state") != "clean"
          )
  
      diff = dataset.diff(
          recursive=True,
          fr=fr,
          to=revision,
          result_filter=changed,
          return_type="generator",
          result_renderer="disabled",
      )
      for r in diff:
          yield r
  
imports: import json
  import logging
  import os.path
  import re
  import sys
  from copy import copy
  from functools import partial
  from itertools import dropwhile
  from datalad.consts import PRE_INIT_COMMIT_SHA
  from datalad.core.local.run import _format_cmd_shorty, assume_ready_opt, format_command, run_command
  from datalad.distribution.dataset import EnsureDataset, datasetmethod, require_dataset
  from datalad.interface.base import Interface, build_doc, eval_results
  from datalad.interface.results import get_status_dict
  from datalad.interface.common_opts import jobs_opt
  from datalad.support.constraints import EnsureNone, EnsureStr
  from datalad.support.exceptions import CapturedException
  from datalad.support.json_py import load_stream
  from datalad.support.param import Parameter
label_desc: Use image node_id 9 for calling a global function with example usage: diff_revision(dataset, revision) and returns: unknown