93663c2cc8c0c8bc3c6f28c27679707305948c80,tests/test_texture.py,,test_cooccurence,#,4

Before Change



def test_cooccurence():
    cooccurence = mahotas._texture.cooccurence
    f = np.array([
          [0,1,1,1],
          [0,0,1,1],
          [2,2,2,2],
        ])
    res = np.zeros((5,5), np.long)
    cooccurence(f, res, 0)
    assert res[0,0] == 1
    assert res[0,1] == 2

After Change



def test_cooccurence():
    np.random.seed(222)
    f = np.random.rand(32, 32)
    f = (f * 255).astype(np.int32)

    assert np.all(mahotas.texture.cooccurence(f, 0) == brute_force(f, 0, 1))
    assert np.all(mahotas.texture.cooccurence(f, 1) == brute_force(f, 1, 1))
    assert np.all(mahotas.texture.cooccurence(f, 2) == brute_force(f, 1, 0))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: luispedro/mahotas
Commit Name: 93663c2cc8c0c8bc3c6f28c27679707305948c80
Time: 2010-05-11
Author: lpc@cmu.edu
File Name: tests/test_texture.py
Class Name:
Method Name: test_cooccurence


Project Name: vitchyr/rlkit
Commit Name: 9bdbb11cf27060e7847a87dcdf691dd6b96ce6df
Time: 2020-08-09
Author: 38036768+YangRui2015@users.noreply.github.com
File Name: rlkit/data_management/obs_dict_replay_buffer.py
Class Name: ObsDictRelabelingBuffer
Method Name: random_batch


Project Name: scikit-image/scikit-image
Commit Name: 54bf5e9f9daf14d281483ad0dbafcf36f44f5ed6
Time: 2020-02-11
Author: rfezzani@gmail.com
File Name: skimage/restoration/tests/test_denoise.py
Class Name:
Method Name: test_denoise_nl_means_2d_multichannel