7d11df30d7b62e47321775c3cd41fbe51a0305b2,pyemma/_base/subset.py,,globalise,#Any#Any#Any#Any#Any#,48

Before Change




def globalise(data, axis, active_set, default_value, n_centers):
    shape_org = _np.shape(data)
    ndim = data.ndim
    n = n_centers if ndim == 1 else n_centers * shape_org[1]
    array = _np.asarray([default_value]).repeat(n)
    if ndim == 1:
        array[active_set] = data
    elif ndim == 2:
        array = array.reshape(-1, shape_org[1])
        if axis == 0:
            array[active_set, :] = data
        elif axis == 1:
            array[:, active_set] = data

After Change


    elif data.ndim == 2:
        expanded_shape = list(data.shape)
        expanded_shape[axis] = n_centers
        array = _np.asarray([default_value]).repeat(
            expanded_shape[0] * expanded_shape[1]).reshape(expanded_shape)
        if axis == 0:
            array[active_set, :] = data
        elif axis == 1:
            array[:, active_set] = data
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 6

Instances


Project Name: markovmodel/PyEMMA
Commit Name: 7d11df30d7b62e47321775c3cd41fbe51a0305b2
Time: 2016-08-18
Author: christoph.wehmeyer@fu-berlin.de
File Name: pyemma/_base/subset.py
Class Name:
Method Name: globalise


Project Name: Calamari-OCR/calamari
Commit Name: de52463f855369ad17148054fa5a0a634c6b99a1
Time: 2021-01-19
Author: christoph.wick@planet-ai.de
File Name: calamari_ocr/ocr/dataset/datareader/pagexml/reader.py
Class Name: PageXMLReader
Method Name: cutout


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: e833f30775bd889fffc46f088cb93d6b42340b49
Time: 2020-07-06
Author: killian.levacher@ibm.com
File Name: tests/classifiersFrameworks/test_tensorflow.py
Class Name:
Method Name: test_class_gradient


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: e833f30775bd889fffc46f088cb93d6b42340b49
Time: 2020-07-06
Author: killian.levacher@ibm.com
File Name: tests/classifiersFrameworks/test_pytorch.py
Class Name:
Method Name: test_class_gradient


Project Name: chainer/chainerrl
Commit Name: 08ed4e477612d49e27baa7bad64be75110a5db0c
Time: 2016-06-09
Author: muupan@gmail.com
File Name: agents/dqn.py
Class Name: DQN
Method Name: act