769299614ec4d02d1421aa562fc8b86c6386fc06,scipy/spatial/kdtree.py,KDTree,__query,#KDTree#Any#Any#Any#Any#Any#,193

Before Change


                a = np.abs(data-x[np.newaxis,:])
                if p==np.inf:
                    ds = np.amax(a,axis=1)
                elif p==1:
                    ds = np.sum(a,axis=1)
                else:
                    ds = np.sum(a**p,axis=1)
                for i in range(len(ds)):
                    if ds[i]<distance_upper_bound:
                        if len(neighbors)==k:
                            heappop(neighbors)

After Change



    def __query(self, x, k=1, eps=0, p=2, distance_upper_bound=np.inf):
        
        side_distances = np.maximum(0,np.maximum(x-self.maxes,self.mins-x))
        if p!=np.inf:
            side_distances**=p
            min_distance = np.sum(side_distances)
        else:
            min_distance = np.amax(side_distances)

        // priority queue for chasing nodes
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: scipy/scipy
Commit Name: 769299614ec4d02d1421aa562fc8b86c6386fc06
Time: 2008-10-12
Author: peridot.faceted@gmail.com
File Name: scipy/spatial/kdtree.py
Class Name: KDTree
Method Name: __query


Project Name: Qiskit/qiskit-aqua
Commit Name: 8ac52eaf2f03402e413101c94301306f41f60a19
Time: 2019-12-12
Author: jules.gacon@googlemail.com
File Name: qiskit/aqua/algorithms/single_sample/amplitude_estimation/iqae.py
Class Name: IterativeAmplitudeEstimation
Method Name: _chernoff_confint


Project Name: etal/cnvkit
Commit Name: a8c287c0b970968feeaae325379668755760a25b
Time: 2015-05-01
Author: eric.talevich@gmail.com
File Name: cnvlib/fix.py
Class Name:
Method Name: apply_weights