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

Before Change


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

After Change


        func, out_dtype, default_1d[0], pass_positions=True
    )

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

    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 = tuple(extrema_lbl.values())

    return result

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: dask/dask-image
Commit Name: f9aea094643fb3240193b0bc0f1908d5b84d82ab
Time: 2018-09-30
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/__init__.py
Class Name:
Method Name: center_of_mass


Project Name: ilastik/ilastik
Commit Name: 558f030de16f0e3ea4ce860aac0d085faad99441
Time: 2019-08-13
Author: k-dominik@users.noreply.github.com
File Name: ilastik/applets/batchProcessing/batchProcessingGui.py
Class Name: BatchProcessingGui
Method Name: run_export