(row, col, data, thresh)
return (np.hstack([row_diag, row]),
            np.hstack([col_diag, col]),
            np.hstack([data_diag, data]))
Run edge collapser on off-diagonal data and then reinsert diagonal
    data.
Run edge collapser on off-diagonal data and then reinsert diagonal
    data.
Run edge collapser on off - diagonal data and then reinsert diagonal data .
def _collapse_coo(row, col, data, thresh):
    """Run edge collapser on off-diagonal data and then reinsert diagonal
    data."""
    diag = row == col
    row_diag, col_diag, data_diag = row[diag], col[diag], data[diag]
    row, col, data = gtda_collapser. \
        flag_complex_collapse_edges_coo(row, col, data, thresh)

    return (np.hstack([row_diag, row]),
            np.hstack([col_diag, col]),
            np.hstack([data_diag, data]))
def _collapse_coo ( row , col , data , thresh ) : diag = row == col row_diag , col_diag , data_diag = row [ diag ] , col [ diag ] , data [ diag ] row , col , data = gtda_collapser . flag_complex_collapse_edges_coo ( row , col , data , thresh ) return ( np . hstack ( [ row_diag , row ] ) , np . hstack ( [ col_diag , col ] ) , np . hstack ( [ data_diag , data ] ) )