def start(self):
        new_grid = self.get_grid()

        if self.target.grid and self.target.grid.reuse_grid > 0:                
            # Reusing the grid 
            if self.target.grid.active \
                    and self.grid == self.target.grid.grid \
                    and type(new_grid) == type(self.target.grid):
                # since we are reusing the grid,
                # we must "cheat" the action that the original vertex coords are
                # the ones that were inherited.
                self.target.grid.vertex_points = self.target.grid.vertex_list.vertices[:]
                self.target.grid.reuse_grid -= 1
                self.target.grid.reuse_grid = max(0, self.target.grid.reuse_grid)
            else:
                # condition are not met
                raise GridException("Cannot reuse grid. class grid or grid size did not match: %s vs %s and %s vs %s"
                                    % (str(self.grid), str(self.target.grid.grid),
                                       type(new_grid), type(self.target.grid)))
        else:
            # Not reusing the grid
            if self.target.grid and self.target.grid.active:
                self.target.grid.active = False
            self.target.grid = new_grid
            self.target.grid.init(self.grid)
            self.target.grid.active = True

        x, y = director.get_window_size()
        self.size_x = x // self.grid.x
        self.size_y = y // self.grid.y
dataset/ETHPy150Open los-cocos/cocos/cocos/actions/basegrid_actions.py/GridBaseAction.start/original