(iter, n=2)
return list(zip(*(iter[i::n] for i in xrange(n))))
Group ``iter`` into tuples of length ``n``. Raise an error if
    the length of ``iter`` is not a multiple of ``n``.
Group ``iter`` into tuples of length ``n``. Raise an error if
    the length of ``iter`` is not a multiple of ``n``.
Group iter into tuples of length n . Raise an error if the length of iter is not a multiple of n .
def unflatten(iter, n=2):
    """Group ``iter`` into tuples of length ``n``. Raise an error if
    the length of ``iter`` is not a multiple of ``n``.
    """
    if n < 1 or len(iter) % n:
        raise ValueError('iter length is not a multiple of %i' % n)
    return list(zip(*(iter[i::n] for i in xrange(n))))
def unflatten ( iter , n = 2 ) : if n < 1 or len ( iter ) % n : raise ValueError ( 'iter length is not a multiple of %i' % n ) return list ( zip ( * ( iter [ i : : n ] for i in xrange ( n ) ) ) )