code: def _pairwise(iterable):
      
      a, b = itertools.tee(iterable)
      next(b, None)
      if sys.version_info.major == 2:
          return itertools.izip(a, b)
      else:
          return zip(a, b)
docs: Wrapper on itertools for SVD_magnitude.