db7e9c2b4ab6f7f9314a112107e1a5669392670d,skimage/util/noise.py,,random_noise,#Any#Any#Any#Any#,8

Before Change


        // Pepper mode
        num_pepper = np.ceil(
            kwargs["amount"] * image.size * (1. - kwargs["salt_vs_pepper"]))
        coords = [np.random.randint(0, i - 1, int(num_pepper))
                  for i in image.shape]
        out[coords] = low_clip

    elif mode == "speckle":
        noise = np.random.normal(kwargs["mean"], kwargs["var"] ** 0.5,

After Change



        // Pepper mode
        p_pepper = kwargs["amount"] * (1 - kwargs["salt_vs_pepper"])
        mask = np.random.choice([True, False], size=image.shape,
                                p=[p_pepper, 1 - p_pepper])
        out[mask] = low_clip

    elif mode == "speckle":
        noise = np.random.normal(kwargs["mean"], kwargs["var"] ** 0.5,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: scikit-image/scikit-image
Commit Name: db7e9c2b4ab6f7f9314a112107e1a5669392670d
Time: 2016-07-26
Author: juan.n@unimelb.edu.au
File Name: skimage/util/noise.py
Class Name:
Method Name: random_noise


Project Name: mne-tools/mne-python
Commit Name: 676ed97f4500511b1dca88ecb1f1ee25dc705d19
Time: 2020-04-30
Author: larson.eric.d@gmail.com
File Name: mne/tests/test_source_space.py
Class Name:
Method Name: test_combine_source_spaces


Project Name: mne-tools/mne-python
Commit Name: 676ed97f4500511b1dca88ecb1f1ee25dc705d19
Time: 2020-04-30
Author: larson.eric.d@gmail.com
File Name: mne/forward/tests/test_make_forward.py
Class Name:
Method Name: test_forward_mixed_source_space