```
class Solution(object):
def subsets(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
size = 2 ** len(nums)
result = []
for i in range(size):
index = 0
cur = i
cur_set = []
while cur > 0:
if cur & 1 == 1:
cur_set.append(nums[index])
cur >>= 1
index += 1
result.append(cur_set)
return result
```