Return a specified grid.
518218
@SuppressWarnings("unused") // called through reflection by RequestServer
  public GridSchemaV99 fetch(int version, GridSchemaV99 s) {
    return s.fillFromImpl(getFromDKV("grid_id", s.grid_id.key(), Grid.class));
  }
1156894
def grid(box, draw)
      x, y, w, h = box.x, box.y, box.width, box.height
      use_cairo do |cc|
        (x..@width + w).step(w)  { |ix| line_xy(ix, y - @height, ix, @height + y, draw) }
        (y..@height + h).step(h) { |iy| line_xy(x - @width, iy, @width + x, iy, draw) }
      end
    end
1121940
def getcol(self, startrow=0, nrow=-1, rowincr=1):
        """"""
        return self._table.getcol(self._column, startrow, nrow, rowincr)
147832
function getGridOffsets(directions, grid, opt) {

        var step = opt.step;

        util.toArray(opt.directions).forEach(function(direction) {

            direction.gridOffsetX = (direction.offsetX / step) * grid.x;
            direction.gridOffsetY = (direction.offsetY / step) * grid.y;
        });
    }
190481
def grid(self, z_x_y):
        
        # sources.py -> MapnikRenderer -> grid
        (z, x, y) = z_x_y
        content = self.reader.grid(z, x, y, self.grid_fields, self.grid_layer)
        return content
305942
function getGrid(step, source, target) {

        return {
            source: source.clone(),
            x: getGridDimension(target.x - source.x, step),
            y: getGridDimension(target.y - source.y, step)
        };
    }
1096210
def geom(self):
        """"""
        adj_nodes = self._grid._graph.nodes_from_line(self)

        return LineString([adj_nodes[0].geom, adj_nodes[1].geom])
92056
def get_grid_spatial_dimensions(self, variable):
        """"""

        data = self.open_dataset(self.service).variables[variable.variable]
        dimensions = list(data.dimensions)
        return data.shape[dimensions.index(variable.x_dimension)], data.shape[dimensions.index(variable.y_dimension)]
879739
def iterGrid(self, minZoom, maxZoom):
        ""
        assert minZoom in range(0, len(self.RESOLUTIONS))
        assert maxZoom in range(0, len(self.RESOLUTIONS))
        assert minZoom <= maxZoom

        for zoom in xrange(minZoom, maxZoom + 1):
            [minRow, minCol, maxRow, maxCol] = self.getExtentAddress(zoom)
            for row in xrange(minRow, maxRow + 1):
                for col in xrange(minCol, maxCol + 1):
                    tileBounds = self.tileBounds(zoom, col, row)
                    yield (tileBounds, zoom, col, row)
18521
def get_discrete_grid(self):
        
        sets_grid = []
        for d in self.space:
            if d.type == 'discrete':
                sets_grid.extend([d.domain]*d.dimensionality)
        return np.array(list(itertools.product(*sets_grid)))
1227424
def extract_row(self,  row):
        
        new_row = []
        for col in range(self.get_grid_width()):
            new_row.append(self.get_tile(row, col))    
        return new_row
596968
def evaluate(grid):
    ""
    if is_won(grid): return -1
    succs = successors(grid)
    return -min(map(evaluate, succs)) if succs else 0
564965
public static GridPane getGridPane() {
        GridPane grid = new GridPane();
        grid.setHgap(10);
        grid.setVgap(10);
        grid.setPadding(new Insets(10, 10, 10, 10));
        return grid;
    }
353351
public Grid grid(double[][][] data) {
        if (base.dimension != 2) {
            throw new IllegalArgumentException("Grid can be only painted in a 2D canvas. Try surface() for 3D grid.");
        }

        Grid grid = new Grid(data);
        add(grid);
        return grid;
    }
11361
def get_grid(self):
        
        mentions, lines = _split_text_n_lines(self.elems)
        # Sort mentions in reading order where y values are snapped to half
        # height-sized grid
        mentions.sort(key=lambda m: (m.yc_grid, m.xc))

        grid = Grid(mentions, lines, self)
        return grid
1324338
def grid_coords_from_corners(upper_left_corner, lower_right_corner, size):
    '''  '''
    assert upper_left_corner.wkt == lower_right_corner.wkt
    geotransform = np.array([upper_left_corner.lon, -(upper_left_corner.lon - lower_right_corner.lon) / float(size[1]), 0,
                            upper_left_corner.lat, 0, -(upper_left_corner.lat - lower_right_corner.lat) / float(size[0])])
    return GridCoordinates(geotransform=geotransform,
                               wkt=upper_left_corner.wkt,
                               y_size=size[0],
                               x_size=size[1])
815641
private Grid getGridLayout(int count) {

        Grid grid = new Grid();
        int x, y, z, modolo = 0;
        x = count % 3;
        y = count % 5;
        z = count % 7;
        if ((z <= y) && (z <= x)) {
            modolo = 7;
        } else if ((y <= z) && (y <= x)) {
            modolo = 5;
        } else if ((x <= z) && (x <= y)) {
            modolo = 3;
        }

        if (count < modolo) {
            grid = new Grid(count, 1);
        } else if ((count % modolo) == 0) {
            grid = new Grid(count / modolo, modolo);
        } else {
            grid = new Grid((count / modolo) + 1, modolo);
        }
        return grid;
    }