a1a0d2e3010f8ade39317709a684bd431d5eef3c,brian2/units/fundamentalunits.py,UnitRegistry,__getitem__,#UnitRegistry#Any#,2037

Before Change


        matching_values = np.asarray(matching)
        x_flat = np.asarray(x).flatten()
        floatreps = np.tile(x_flat, (len(matching), 1)).T / matching_values
        good_reps = np.sum((np.abs(floatreps) >= 0.1) & (np.abs(floatreps) < 1000),
                           axis=0)
        if any(good_reps):
            return matching[good_reps.argmax()]
        else:
            return matching[0]

After Change


        // determine how well this unit represents the value
        matching_values = np.asarray(matching)
        x_flat = np.asarray(x).flatten()
        floatreps = np.tile(np.abs(x_flat), (len(matching), 1)).T / matching_values
        // ignore zeros, they are well represented in any unit
        floatreps[floatreps == 0] = np.nan
        if np.all(np.isnan(floatreps)):
            return matching[0]  // all zeros, use the base unit
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: brian-team/brian2
Commit Name: a1a0d2e3010f8ade39317709a684bd431d5eef3c
Time: 2014-10-02
Author: marcel.stimberg@ens.fr
File Name: brian2/units/fundamentalunits.py
Class Name: UnitRegistry
Method Name: __getitem__


Project Name: EpistasisLab/scikit-rebate
Commit Name: ece383696800b9b34854df27a65a3d1d74669952
Time: 2020-05-28
Author: alexmxu@alexs-mbp-3.attlocal.net
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit


Project Name: EpistasisLab/scikit-rebate
Commit Name: 163eb7df13667e21b0e02a2706e18d1f53eee610
Time: 2020-01-29
Author: alexmxu99@gmail.com
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit