ea40a555956467d98c7d321633a73cf408d9a805,skimage/color/colorlabel.py,,_match_label_with_color,#Any#Any#Any#Any#,42
Before Change
bg_color = (0, 0, 0)
bg_color = _rgb_vector([bg_color])
unique_labels = list(set(label.flat))
// Ensure that the background label is in front to match call to `chain`.
if bg_label in unique_labels:
unique_labels.remove(bg_label)
unique_labels.insert(0, bg_label)
After Change
// color cycle. bg_label should always be mapped to the first color, so
// its rank must be 0. Other labels should be ranked from small to large
// from 1.
if len(bg_label_rank_list) > 0:
bg_label_rank = bg_label_rank_list[0]
mapped_labels[mapped_labels < bg_label_rank] += 1
mapped_labels[label.flat == bg_label] = 0
else:
mapped_labels += 1
// Modify labels and color cycle so background color is used only once.
color_cycle = itertools.cycle(colors)
color_cycle = itertools.chain(bg_color, color_cycle)
return mapped_labels, color_cycle
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 7
Instances Project Name: scikit-image/scikit-image
Commit Name: ea40a555956467d98c7d321633a73cf408d9a805
Time: 2016-11-08
Author: yue@berkeley.edu
File Name: skimage/color/colorlabel.py
Class Name:
Method Name: _match_label_with_color
Project Name: gboeing/osmnx
Commit Name: dfe8d88a87a4b98f831f69012e22f8b7611f7d25
Time: 2020-05-13
Author: boeing@usc.edu
File Name: osmnx/simplify.py
Class Name:
Method Name: consolidate_intersections_rebuild_graph
Project Name: soft-matter/trackpy
Commit Name: 42be11c7824427fb0a8490f3bcd635410ded57b3
Time: 2017-07-27
Author: caspervdw@gmail.com
File Name: trackpy/linking/find_link.py
Class Name: FindLinker
Method Name: get_relocate_candidates
Project Name: rasbt/mlxtend
Commit Name: cbe17d7c0be2587b876225bdea08abbed426f17c
Time: 2019-06-23
Author: harenbergsd@gmail.com
File Name: mlxtend/frequent_patterns/apriori.py
Class Name:
Method Name: apriori