b8a5e5db6c2c0ff9540d84c11c05b21fc6023ae6,skimage/color/colorconv.py,,rgba2rgb,#,163

Before Change


    
    arr = _prepare_rgba_array(rgba)
    if isinstance(background, tuple) and len(background) != 3:
        raise ValueError("the background must be a tuple with 3 items - the "
                         "RGB color of the background. Got {0} items."
                         .format(len(background)))

    alpha = arr[..., -1]
    channels = arr[..., :-1]
    out = np.empty_like(channels)

After Change


    if len(background) != 3:
        raise ValueError("background must be an array-like containing 3 RGB "
                         f"values. Got {len(background)} items")
    if np.any(background < 0) or np.any(background > 1):
        raise ValueError("background RGB values must be floats between "
                         "0 and 1.")

    background = background[np.newaxis, ...]
    alpha = arr[..., -1, np.newaxis]
    channels = arr[np.newaxis, ..., :-1]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: scikit-image/scikit-image
Commit Name: b8a5e5db6c2c0ff9540d84c11c05b21fc6023ae6
Time: 2020-05-04
Author: rfezzani@gmail.com
File Name: skimage/color/colorconv.py
Class Name:
Method Name: rgba2rgb


Project Name: craffel/mir_eval
Commit Name: 3241912f4160c47e55e25f5812c8493d1f581fca
Time: 2014-04-23
Author: brm2132@columbia.edu
File Name: mir_eval/util.py
Class Name:
Method Name: validate_intervals


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: 970491cd9b3cb21b043c22b50b4d09f9dd2481a7
Time: 2018-10-19
Author: jan@motl.us
File Name: category_encoders/woe.py
Class Name: WOEEncoder
Method Name: _score