61f037c3ab9dd7df522134b3048cebcf3f62e43f,skimage/draw/_random_shapes.py,,_generate_rectangle_mask,#Any#Any#Any#Any#,9
Before Change
raise ArithmeticError("cannot fit shape to image")
// Pick random widths and heights.
r = random.randint(shape[0], available_height + 1)
c = random.randint(shape[0], available_width + 1)
rectangle = draw_polygon([
point[0],
point[0] + r,
point[0] + r,
After Change
A mask of indices that the shape fills.
available_width = min(image[1] - point[1], shape[1]) - shape[0]
available_height = min(image[0] - point[0], shape[1]) - shape[0]
// Pick random widths and heights.
r = shape[0] + random.randint(max(1, available_height)) - 1
c = shape[0] + random.randint(max(1, available_width)) - 1
rectangle = draw_polygon([
point[0],
point[0] + r,
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 3
Instances
Project Name: scikit-image/scikit-image
Commit Name: 61f037c3ab9dd7df522134b3048cebcf3f62e43f
Time: 2020-10-28
Author: rfezzani@gmail.com
File Name: skimage/draw/_random_shapes.py
Class Name:
Method Name: _generate_rectangle_mask
Project Name: david-abel/simple_rl
Commit Name: 335d758f3348cb2b7a1e03cb8248dfde39f8c439
Time: 2018-08-23
Author: david_abel@brown.edu
File Name: simple_rl/abstraction/state_abs/sa_helpers.py
Class Name:
Method Name: visualize_state_abstr_grid
Project Name: tensorflow/magenta
Commit Name: 039cd8bce40d86408fbb00eda3786a5b706a03e1
Time: 2016-10-27
Author: curtis@thefjord.org
File Name: magenta/models/melody_rnn/melody_rnn_sequence_generator.py
Class Name: MelodyRnnSequenceGenerator
Method Name: _generate
Project Name: scikit-image/scikit-image
Commit Name: 61f037c3ab9dd7df522134b3048cebcf3f62e43f
Time: 2020-10-28
Author: rfezzani@gmail.com
File Name: skimage/draw/_random_shapes.py
Class Name:
Method Name: _generate_triangle_mask