import itertools


def powerset(x):
    """
    Return power set of set x
    """
    n = len(x)
    ps = list()
    for i in range(1, n + 1):
        s = itertools.combinations(x, i)  # singletons tuples are generated here
        retval = [val for val in s]
        ps.extend(retval)
    return ps