Takes n elements (not necessarily distinct) from the sequence, order
    matters.

    @see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465

def xselections(items, n):
    """ Takes n elements (not necessarily distinct) from the sequence, order
    matters.

    @see: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465
    """
    if n==0:
        yield []
    else:
        for i in xrange(len(items)):
            for ss in xselections(items, n-1):
                yield [items[i]]+ss