def eq_assoccomm(u, v):
    try:
        uop, uargs = op_args(u)
        vop, vargs = op_args(v)
    except ValueError:
        return (eq, u, v)

    if uop and not vop and not isvar(v):
        return fail
    if vop and not uop and not isvar(u):
        return fail
    if uop and vop and not uop == vop:
        return fail
    if uop and not (uop,) in associative.facts:
        return (eq, u, v)
    if vop and not (vop,) in associative.facts:
        return (eq, u, v)

    if uop and vop:
        u, v = (u, v) if len(uargs) >= len(vargs) else (v, u)
        n = min(map(len, (uargs, vargs)))  # length of shorter tail
    else:
        n = None
    if vop and not uop:
        u, v = v, u
    w = var()
    return (lall, (eq_assoc, u, w, eq_assoccomm, n),
                  (eq_comm, v, w, eq_assoccomm))
Suspend an instance in its cell.
dataset/ETHPy150Open logpy/logpy/logpy/assoccomm.py/eq_assoccomm--crossover with--dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/cells/rpcapi.py/CellsAPI.suspend_instance