code: def pairwise(iterable):
      
      it = iter(iterable)
      a = next(it, None)
  
      for b in it:
          yield (a, b)
          a = b
docs: given an interable `p1, p2, p3, ...`
      it iterates through pairwise tuples `(p0, p1), (p1, p2), ...`