code: def check_dates(
      repo,
      timestamp=None,
      which="newer",
      revs=None,
      annex=True,
      tags=True,
  ):
      """Search for dates in `repo` that are newer than `timestamp`.
  
      This examines commit logs of local branches and the content of blobs in the
      git-annex branch.
  
      Parameters
      ----------
      repo : GitRepo or str
          If a str is passed, it is taken as the path to a GitRepo.
      timestamp : int, optional
          Unix timestamp.  It defaults to a day before now.
      which : {"newer", "older"}
          Whether to return timestamps that are newer or older than `timestamp`.
      revs : list, optional
          Search for commit timestamps in commits that are area reachable from
          these revisions. Any revision-specification allowed by `git log` can be
          used, including things like `--all`. Defaults to all local branches.
      annex : {True, "tree", False}, optional
          If True, search the content of all blobs in the git-annex branch.  If
          "tree", search only the blobs that are in the tree of the tip of the
          git-annex branch.  If False, do not search git-annex blobs.
      tags : bool, optional
          Whether to check dates the dates of annotated tags.
  
      Returns
      -------
      A dict that reports newer timestamps.
      """
      if isinstance(repo, str):
          repo = GitRepo(repo, create=False)
  
      if timestamp is None:
          timestamp = int(time.time()) - 60 * 60 * 24
  
      if which == "newer":
          cmp_fn = operator.gt
      elif which == "older":
          cmp_fn = operator.lt
      else:
          raise ValueError(
              "unrecognized value for `which`: {}".format(which)
          )
  
      results = {}
  
      lgr.debug("Checking dates in logs")
      for hexsha, a_timestamp, c_timestamp in log_dates(
          repo, revs=revs
      ):
          if cmp_fn(a_timestamp, timestamp) or cmp_fn(
              c_timestamp, timestamp
          ):
              results[hexsha] = {
                  "type": "commit",
                  "author-timestamp": a_timestamp,
                  "committer-timestamp": c_timestamp,
              }
  
      if tags:
          lgr.debug("Checking dates of annotated tags")
          for hexsha, tag_timestamp in tag_dates(repo):
              if cmp_fn(tag_timestamp, timestamp):
                  results[hexsha] = {
                      "type": "tag",
                      "timestamp": tag_timestamp,
                  }
  
      if annex and "git-annex" in repo.get_branches():
          all_objects = annex != "tree"
          lgr.debug(
              "Checking dates in blobs of git-annex branch%s",
              "" if all_objects else "'s tip",
          )
          for hexsha, timestamps, fname in annex_dates(
              repo, all_objects
          ):
              hits = [ts for ts in timestamps if cmp_fn(ts, timestamp)]
              if hits:
                  results[hexsha] = {
                      "type": "annex-blob",
                      "timestamps": hits,
                      "filename": fname,
                  }
  
      return {
          "reference-timestamp": timestamp,
          "which": which,
          "objects": results,
      }
  
file_path: datalad/datalad/support/repodates.py
imports: import logging
  import operator
  import re
  import time
  from datalad.log import log_progress
  from datalad.support.exceptions import CommandError
  from datalad.support.gitrepo import GitRepo
label_desc: Use image node_id 8 for calling a global function with example usage: check_dates(repo, timestamp, which, revs, annex, tags) and returns: dict