8cb97248c6fe5b84312a3e4f74c20bfb19cc8d0e,skbio/tree/_nj.py,,_compute_collapsed_dm,#Any#Any#Any#Any#Any#,186

Before Change


    out_ids = [new_node_id]
    out_ids.extend([e for e in dm.ids if e not in (i, j)])
    result = np.zeros((out_n, out_n))
    for idx1, out_id1 in enumerate(out_ids[1:]):
        result[0, idx1 + 1] = result[idx1 + 1, 0] = _otu_to_new_node(
            dm, i, j, out_id1, disallow_negative_branch_length)
        for idx2, out_id2 in enumerate(out_ids[1:idx1+1]):
            result[idx1+1, idx2+1] = result[idx2+1, idx1+1] = \
                dm[out_id1, out_id2]
    return DistanceMatrix(result, out_ids)


def _lowest_index(dm):

After Change


    result = np.zeros((out_n, out_n))
    // pre-populate the result array with known distances
    ij_indexes = [dm.index(i), dm.index(j)]
    result[1:, 1:] = np.delete(np.delete(dm.data, ij_indexes, axis=0),
                               ij_indexes, axis=1)
    // calculate the new distances from the current DistanceMatrix
    k_to_u = 0.5 * (dm[i] + dm[j] - dm[i, j])
    // set negative branches to 0 if specified
    if disallow_negative_branch_length:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: biocore/scikit-bio
Commit Name: 8cb97248c6fe5b84312a3e4f74c20bfb19cc8d0e
Time: 2017-04-27
Author: sdbrown@gmail.com
File Name: skbio/tree/_nj.py
Class Name:
Method Name: _compute_collapsed_dm


Project Name: matplotlib/matplotlib
Commit Name: a7c4e9fbfeefbc78500bed3932f5820cbe3e5b4e
Time: 2017-10-13
Author: fuzzy0427@gmail.com
File Name: examples/event_handling/poly_editor.py
Class Name: PolygonInteractor
Method Name: key_press_callback


Project Name: matplotlib/matplotlib
Commit Name: 6a18d6b58ec3ca42de7bc2cf5206f117c59e3318
Time: 2017-10-21
Author: tcaswell@gmail.com
File Name: examples/event_handling/poly_editor.py
Class Name: PolygonInteractor
Method Name: key_press_callback