1c260c438967e16675898bc1c81d462b4aacbed1,src/rastervision/core/box.py,Box,make_random_square,#Box#Any#,107

Before Change


        rand_y = int(np.random.uniform(0, ub))

        ub = self.get_width() - size
        rand_x = int(np.random.uniform(0, ub))

        return Box.make_square(rand_y, rand_x, size)

    @staticmethod

After Change


        Args:
            size: the height and width of the new Box
        
        if size >= self.get_width():
            raise ValueError("size of random square cannot be >= width")

        if size >= self.get_height():
            raise ValueError("size of random square cannot be >= height")

        lb = self.ymin
        ub = self.ymax - size
        rand_y = random.randint(lb, ub)

        lb = self.xmin
        ub = self.xmax - size
        rand_x = random.randint(lb, ub)

        return Box.make_square(rand_y, rand_x, size)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: azavea/raster-vision
Commit Name: 1c260c438967e16675898bc1c81d462b4aacbed1
Time: 2018-08-16
Author: lewfish@gmail.com
File Name: src/rastervision/core/box.py
Class Name: Box
Method Name: make_random_square


Project Name: pymc-devs/pymc3
Commit Name: 15222e31e2b7ed30b7ecca1e85f9b6f032f1cbf2
Time: 2012-05-22
Author: chris.fonnesbeck@vanderbilt.edu
File Name: pymc/Matplot.py
Class Name:
Method Name: gof_plot


Project Name: pymc-devs/pymc3
Commit Name: 15222e31e2b7ed30b7ecca1e85f9b6f032f1cbf2
Time: 2012-05-22
Author: chris.fonnesbeck@vanderbilt.edu
File Name: pymc/Matplot.py
Class Name:
Method Name: histogram