def decrement_part(self, part):
        plen = len(part)
        for j in range(plen - 1, -1, -1):
            if (j == 0 and part[j].v > 1) or (j > 0 and part[j].v > 0):
                # found val to decrement
                part[j].v -= 1
                # Reset trailing parts back to maximum
                for k in range(j + 1, plen):
                    part[k].v = part[k].u
                return True
        return False

    # Version to allow number of parts to be bounded from above.
    # Corresponds to (a modified) step M5.
Decrements part (a subrange of pstack), if possible, returning
dataset/ETHPy150Open sympy/sympy/sympy/utilities/enumerative.py/MultisetPartitionTraverser.decrement_part