code: def prev_this_next(it, sentinel=None):
      """Utility to return (prev, this, next) tuples from an iterator"""
      i1, i2, i3 = itertools.tee(it, 3)
      next(i3, None)
      return zip(
          itertools.chain([sentinel], i1),
          i2,
          itertools.chain(i3, [sentinel]),
      )
  
file_path: altair/sphinxext/utils.py
imports: import ast
  import hashlib
  import itertools
  import json
  import re
label_desc: Use image node_id 5 for calling a global function with example usage: prev_this_next(it, sentinel) and returns: zip