def _zip_flatten(x, ys):
    '''
    intersperse x into ys, with an extra element at the beginning.
    '''
    return itertools.chain.from_iterable(
            zip(itertools.repeat(x), ys))
intersperse x into ys, with an extra element at the beginning.