c890a06b4ef71d5827ff9a399e203a37af0191a5,skimage/exposure/exposure.py,,_bincount_histogram,#Any#Any#,38

Before Change


        bin_centers = np.arange(image_min, image_max + 1)
        // Add zeros at the end of the hist array to get the correct size
        zero_hist = np.zeros(image_max - image_min - hist.shape[0] + 1)
        hist = np.concatenate((hist, zero_hist))
    else:
        ValueError("Wrong value for the `source_range` argument")

    return hist, bin_centers

After Change


def _bincount_histogram(image, source_range):
    Efficient histogram calculation for a flat image of integers.
    if source_range not in ["image", "dtype"]:
        raise ValueError("Incorrect value for `source_range` argument: {}".format(source_range))
    if source_range == "image":
        image_min = np.min(image).astype(np.int64)
        image_max = np.max(image).astype(np.int64)
    elif source_range == "dtype":
        image_min, image_max = dtype_limits(image, clip_negative=False)
    image, offset = _offset_array(image, image_min, image_max)
    hist = np.bincount(image.ravel(), minlength=image_max - image_min + 1)
    bin_centers = np.arange(image_min, image_max + 1)
    if source_range == "image":
        idx = max(image_min, 0)
        hist = hist[idx:]
    return hist, bin_centers


def histogram(image, nbins=256, source_range="image", normalize=False):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: scikit-image/scikit-image
Commit Name: c890a06b4ef71d5827ff9a399e203a37af0191a5
Time: 2018-12-06
Author: devel@sciunto.org
File Name: skimage/exposure/exposure.py
Class Name:
Method Name: _bincount_histogram


Project Name: luispedro/mahotas
Commit Name: 64624fb2b46a228fef1141e1ded84e52acccaf6e
Time: 2015-06-09
Author: luis@luispedro.org
File Name: bin/mahotas-features.py
Class Name:
Method Name: main


Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 2e7c0700d00da702cdccb7c19b6fe1857b5bd1b7
Time: 2017-08-24
Author: g.lemaitre58@gmail.com
File Name: imblearn/under_sampling/prototype_generation/cluster_centroids.py
Class Name: ClusterCentroids
Method Name: _sample