def mask_to_list(mask):
    size = len(bin(mask)) - 2  # because of "0b"
    return [size - i - 1 for i in xrange(size)
            if mask & (1 << size - i - 1)]
Converts the specfied integer bitmask into a list of
dataset/ETHPy150Open ARM-software/workload-automation/wlauto/utils/misc.py/mask_to_list