8a573aac88f55305aceec84086e30f8b883a4bcb,scipy/sparse/construct.py,,block_diag,#Any#Any#Any#,628

Before Change


        else:
            a = csr_matrix(a)
        nrows, ncols = a.shape
        for r in range(nrows):
            for c in range(ncols):
                row.append(r + r_idx)
                col.append(c + c_idx)
                data.append(a[r, c])
        r_idx = r_idx + nrows
        c_idx = c_idx + ncols
    return coo_matrix((data, (row, col)), dtype=dtype).asformat(format)

After Change


        if isinstance(a, (list, numbers.Number)):
            a = csr_matrix(a)
        nrows, ncols = a.shape
        for r, c in zip(*a.nonzero()):
            row.append(r + r_idx)
            col.append(c + c_idx)
            data.append(a[r, c])
        r_idx = r_idx + nrows
        c_idx = c_idx + ncols
    return coo_matrix((data, (row, col)),
                      shape=(r_idx, c_idx),
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: scipy/scipy
Commit Name: 8a573aac88f55305aceec84086e30f8b883a4bcb
Time: 2020-07-10
Author: git@jjerphan.xyz
File Name: scipy/sparse/construct.py
Class Name:
Method Name: block_diag


Project Name: biocore/scikit-bio
Commit Name: d4498d719f830e816aa383fa7d5b9c86f7f04a49
Time: 2014-07-30
Author: jsanders@oeb.harvard.edu
File Name: skbio/math/stats/evolve/hommola.py
Class Name:
Method Name: hommola_cospeciation


Project Name: cornellius-gp/gpytorch
Commit Name: 9b664bd7cd8dbb9657626166ba61887ed06774d7
Time: 2017-09-13
Author: gpleiss@gmail.com
File Name: gpytorch/utils/toeplitz.py
Class Name:
Method Name: index_coef_to_sparse