def cols_disagree(mat, val):
    "\n            is_success = prop2_mat['is_success']\n            "
    nCols = mat.shape[1]
    sums = mat.sum(axis=1)
    disagree_flags1d = np.logical_and((sums > 0), (sums < nCols))
    disagree_flags2d = np.tile(disagree_flags1d[:, None], (1, nCols))
    if (not val):
        flags = np.logical_not(disagree_flags2d)
    else:
        flags = disagree_flags2d
    return flags
is_success = prop2_mat['is_success']
def cols_disagree(mat, val):
    "\n            \n            "
    nCols = mat.shape[1]
    sums = mat.sum(axis=1)
    disagree_flags1d = np.logical_and((sums > 0), (sums < nCols))
    disagree_flags2d = np.tile(disagree_flags1d[:, None], (1, nCols))
    if (not val):
        flags = np.logical_not(disagree_flags2d)
    else:
        flags = disagree_flags2d
    return flags