def bc_dist(expr):
    factor, mat = expr.as_coeff_mmul()
    if factor != 1 and isinstance(unpack(mat), BlockMatrix):
        B = unpack(mat).blocks
        return BlockMatrix([[factor * B[i, j] for j in range(B.cols)]
                                              for i in range(B.rows)])
    return expr
get opt
dataset/ETHPy150Open sympy/sympy/sympy/matrices/expressions/blockmatrix.py/bc_dist--crossover with--dataset/ETHPy150Open circus-tent/circus/circus/util.py/convert_opt