code: def _cat_blob(repo, obj, bad_ok=False):
      """Call `git cat-file blob OBJ`.
  
      Parameters
      ----------
      repo : GitRepo
      obj : str
          Blob object.
      bad_ok : boolean, optional
          Don't fail if `obj` doesn't name a known blob.
  
      Returns
      -------
      Blob's content (str) or None if `obj` is not and `bad_ok` is true.
      """
      if bad_ok:
          kwds = {"expect_fail": True, "expect_stderr": True}
      else:
          kwds = {}
  
      try:
          out_cat = repo.call_git(
              ["cat-file", "blob", obj], read_only=True, **kwds
          )
      except CommandError as exc:
          if bad_ok and "bad file" in exc.stderr:
              out_cat = None
          else:
              raise
      return out_cat
  
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 1 for calling a global function with example usage: _cat_blob(repo, obj, bad_ok) and returns: out_cat