c9fd2c425cb873508ba16221819574400ad2443e,dask_image/ndmeasure/__init__.py,,extrema,#,75

Before Change


        _utils._extrema, out_dtype, default, pass_positions=True
    )

    extrema_lbl = {k: extrema_lbl[k] for k in extrema_lbl.dtype.names}

    for pos_key in ["min_pos", "max_pos"]:
        pos_1d = extrema_lbl[pos_key]
        if not pos_1d.ndim:
            pos_1d = pos_1d[None]

        pos_nd = _utils._unravel_index(pos_1d, input.shape)

        if index.ndim == 0:
            pos_nd = dask.array.squeeze(pos_nd)
        elif index.ndim > 1:
            pos_nd = pos_nd.reshape(
                (int(numpy.prod(pos_nd.shape[:-1])), pos_nd.shape[-1])
            )

        extrema_lbl[pos_key] = pos_nd

    result = (
        extrema_lbl["min_val"],
        extrema_lbl["max_val"],
        extrema_lbl["min_pos"],
        extrema_lbl["max_pos"]
    )

    return result

After Change


    )

    extrema_lbl = collections.OrderedDict([
        (k, extrema_lbl[k]) for k in type_mapping.keys()
    ])

    for pos_key in ["min_pos", "max_pos"]:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: dask/dask-image
Commit Name: c9fd2c425cb873508ba16221819574400ad2443e
Time: 2018-09-30
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/__init__.py
Class Name:
Method Name: extrema


Project Name: cesium-ml/cesium
Commit Name: 2ab1119596b420cc696a783271d617562ccf7e28
Time: 2017-03-29
Author: brettnaul@gmail.com
File Name: cesium/tests/fixtures.py
Class Name:
Method Name: sample_featureset


Project Name: scikit-optimize/scikit-optimize
Commit Name: a81db6daadd1304e96916c34a894d83dd4dc75bd
Time: 2017-06-28
Author: iaroslav.email@gmail.com
File Name: skopt/wrappers/scikit_learn.py
Class Name: SkoptSearchCV
Method Name: step