Credits ======= The code for the ``generate_subsets()`` function is derived heavily from `Allen Downey `_'s `Stack Overflow answer `_.