@classmethod
    def flatten(cls, seq):
        # apply associativity, no commutativity property is used
        new_seq = []
        while seq:
            o = seq.pop()
            if o.__class__ is cls:  # classes must match exactly
                seq.extend(o.args)
            else:
                new_seq.append(o)
        # c_part, nc_part, order_symbols
        return [], new_seq, None
Return seq so that none of the elements are of type `cls`. This is
dataset/ETHPy150Open sympy/sympy/sympy/core/operations.py/AssocOp.flatten