b470898504d2a077433a84e12a7c8078b2494760,dask_image/ndmeasure/__init__.py,,center_of_mass,#Any#Any#Any#,21

Before Change


    type_mapping = collections.OrderedDict([
        (("%i" % i), input.dtype) for i in _pycompat.irange(input.ndim)
    ])
    out_dtype = numpy.dtype(list(type_mapping.items()))

    default_1d = numpy.full((1,), numpy.nan, dtype=out_dtype)

    func = functools.partial(
        _utils._center_of_mass, shape=input.shape, dtype=out_dtype
    )
    com_lbl = labeled_comprehension(
        input, labels, index,
        func, out_dtype, default_1d[0], pass_positions=True
    )

    com_lbl = dask.array.stack([com_lbl[k] for k in type_mapping], axis=-1)

    return com_lbl

After Change


    // This only matters if index is some array.
    index = index.T

    out_dtype = numpy.dtype([("com", input.dtype, (input.ndim,))])
    default_1d = numpy.full((1,), numpy.nan, dtype=out_dtype)

    func = functools.partial(
        _utils._center_of_mass, shape=input.shape, dtype=out_dtype
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dask/dask-image
Commit Name: b470898504d2a077433a84e12a7c8078b2494760
Time: 2018-10-01
Author: jakirkham@gmail.com
File Name: dask_image/ndmeasure/__init__.py
Class Name:
Method Name: center_of_mass


Project Name: scipy/scipy
Commit Name: ef7707947b85d141e955e844ec1800df9eddb5c2
Time: 2018-12-26
Author: ilhanpolat@gmail.com
File Name: scipy/linalg/blas.py
Class Name:
Method Name: find_best_blas_type


Project Name: deepfakes/faceswap
Commit Name: b46c02d10494877e991b2c560f8acd957fa104b4
Time: 2020-10-18
Author: 36920800+torzdf@users.noreply.github.com
File Name: plugins/extract/detect/s3fd.py
Class Name: ConstantLayerO2K
Method Name: __init__