set the sheet/row/col to the values in the replay row.  return sheet
337565
def moveToReplayContext(self, r):
        ''
        if not r.sheet:
#            assert not r.col and not r.row
            return self  # any old sheet should do, row/column don't matter

        try:
            sheetidx = int(r.sheet)
            vs = vd().sheets[sheetidx]
        except ValueError:
            vs = vd().getSheet(r.sheet) or error('no sheet named %s' % r.sheet)

        if r.row:
            try:
                rowidx = int(r.row)
            except ValueError:
                rowidx = indexMatch(vs.rows, lambda r,vs=vs,k=r.row: keystr(vs.rowkey(r)) == k)

            if rowidx is None:
                error('no "%s" row' % r.row)

            if options.replay_movement:
                while vs.cursorRowIndex != rowidx:
                    vs.cursorRowIndex += 1 if (rowidx - vs.cursorRowIndex) > 0 else -1
                    while not self.delay(0.5):
                        pass
            else:
                vs.cursorRowIndex = rowidx

        if r.col:
            try:
                vcolidx = int(r.col)
            except ValueError:
                vcolidx = indexMatch(vs.visibleCols, lambda c,name=r.col: name == c.name)

            if vcolidx is None:
                error('no "%s" column' % r.col)

            if options.replay_movement:
                while vs.cursorVisibleColIndex != vcolidx:
                    vs.cursorVisibleColIndex += 1 if (vcolidx - vs.cursorVisibleColIndex) > 0 else -1
                    while not self.delay(0.5):
                        pass

                assert vs.cursorVisibleColIndex == vcolidx
            else:
                vs.cursorVisibleColIndex = vcolidx
        return vs
992743
def setRows(self, rows):
        
        self._raster[0] = rows
        if self._raster[1] == 0:
            self._raster[1] = 1
325187
def setformrowcol r, c
           @form.row = r unless r.nil?
           @form.col = c unless c.nil?
           # this is stupid, going through this route i was losing windows top and left
           # And this could get repeated if there are mult objects. 
        if !@parent_component.nil? and @parent_component != self
           r+= @parent_component.form.window.top unless  r.nil?
           c+= @parent_component.form.window.left unless c.nil?
           $log.debug " (#{@name}) calling parents setformrowcol #{r}, #{c} pa: #{@parent_component.name} self: #{name}, #{self.class}, poff #{@parent_component.row_offset}, #{@parent_component.col_offset}, top:#{@form.window.left} left:#{@form.window.left} "
           @parent_component.setformrowcol r, c
        else
           # no more parents, now set form
           $log.debug " name NO MORE parents setting #{r}, #{c}    in #{@form} "
           @form.setrowcol r, c
        end
     end
342232
def clean_values(self):
    
    for row in self.rows:
      for index, cell in enumerate(row):
        self.set_cell_value(row, index, self.clean_value(self.get_cell_value(cell)))
    return self
425407
def row(row, val = nil)
      if val.nil?
        get_row(row)
      else
        set_row(row, val)
      end
    end
856031
public static Row getOrCreateRow(Sheet sheet, int rowIndex) {
		Row row = sheet.getRow(rowIndex);
		if (null == row) {
			row = sheet.createRow(rowIndex);
		}
		return row;
	}
279857
def set_form_row
      return :UNHANDLED if @current_component.nil?
      cc = @current_component
      $log.debug "CONT #{@name} set_form_row calling sfr for #{cc.name}, r #{cc.row} c: #{cc.col} "
      $log.debug " CONTAINER on enter sfr #{@current_component.name}  #{@current_component} "

      # bug caught here. we were printing a field before it had been set, so it printed out
      @components.each { |e| correct_component e } if @first_time
      @current_component.on_enter
      @current_component.set_form_row # why was this missing in vimsplit. is it
        $log.debug "CONT2 #{@name} set_form_row calling sfr for #{cc.name}, r #{cc.row} c: #{cc.col} "
      # that on_enter does a set_form_row
      @current_component.set_form_col # XXX 
      @current_component.repaint # OMG this could happen before we've set row and col
      # XXX compo should do set_form_row and col if it has that
    end
393173
def to_cell_table(self, merged=True):
    """"""
    new_rows = []
    for row_index, row in enumerate(self.rows(CellMode.cooked)):
      new_row = []
      for col_index, cell_value in enumerate(row):
        new_row.append(Cell(cell_value, self.get_note((col_index, row_index))))
      new_rows.append(new_row)
    if merged:
      for cell_low, cell_high in self.merged_cell_ranges():
        anchor_cell = new_rows[cell_low[1]][cell_low[0]]
        for row_index in range(cell_low[1], cell_high[1]):
          for col_index in range(cell_low[0], cell_high[0]):
            # NOTE: xlrd occassionally returns ranges that don't have cells.
            try:
              new_rows[row_index][col_index] = anchor_cell.copy()
            except IndexError:
              pass
    return new_rows
1277892
public static Cell[] getColumn(final Sheet sheet, final int col) {
        ArgUtils.notNull(sheet, "sheet");

        int maxRow = getRows(sheet);
        Cell[] cells = new Cell[maxRow];
        for(int i=0; i < maxRow; i++) {
            Row rows = sheet.getRow(i);
            if(rows == null) {
                rows = sheet.createRow(i);

            }

            Cell cell = rows.getCell(col);
            if(cell == null) {
                cell = rows.createCell(col, CellType.BLANK);
            }

            cells[i] = cell;
        }

        return cells;
    }
747747
def traverse_to_chron_var(temp_sheet):
    
    row = 0
    while row < temp_sheet.nrows - 1:
        if 'Parameter' in temp_sheet.cell_value(row, 0):
            row += 1
            break
        row += 1
    logger_excel.info("traverse_to_chron_var: row:{}".format(row))
    return row
604261
def resize(self, rows=None, cols=None):
        
        grid_properties = {}

        if rows is not None:
            grid_properties['rowCount'] = rows

        if cols is not None:
            grid_properties['columnCount'] = cols

        if not grid_properties:
            raise TypeError("Either 'rows' or 'cols' should be specified.")

        fields = ','.join(
            'gridProperties/%s' % p for p in grid_properties.keys()
        )

        body = {
            'requests': [{
                'updateSheetProperties': {
                    'properties': {
                        'sheetId': self.id,
                        'gridProperties': grid_properties
                    },
                    'fields': fields
                }
            }]
        }

        return self.spreadsheet.batch_update(body)
57272
def set_tile(self, row, col, value):
           
        #print('set_tile: y=', row, 'x=', col)
        if col < 0:
            print("ERROR - x less than zero", col)
            col = 0
            #return
            
        if col > self.grid_width - 1 :
            print("ERROR - x larger than grid", col)
            col = self.grid_width - 1
            #return
            
        if row < 0:
            print("ERROR - y less than zero", row)
            row = 0
            #return
            
        if row > self.grid_height - 1:
            print("ERROR - y larger than grid", row)
            row = self.grid_height - 1

        self.grid[row][col] = value
1093531
def read_data(self, sheet, begin=None):
        
        line = self.begin
        rows = sheet.rows
        for i in range(line-1):
            rows.next()
        template_line = self.template[self.begin-1]
        if not template_line['subs']:
            raise ValueError("Template definition is not right")

        for row in rows:
            d = {}
            for c in template_line['subs'][0]['cols']:
                if c['field']:
                    cell = row[c['col']-1]
                    if isinstance(cell.value, (str, unicode)):
                        v = cell.value.strip()
                    else:
                        v = cell.value
                    d[c['field']] = v
            yield d
1036183
def _get_cols(row_content):
    
    cols = []
    subcell_col = []
    prev_bar = None
    for _coord, item in row_content:
        if isinstance(item, LTTextLine):
            subcell_col.append(item)
        else:  # bar, add column content
            # When there is no content, we count a None column
            if prev_bar:
                bar_ranges = (prev_bar, item)
                col_items = subcell_col if subcell_col else [None]
                cols.extend([bar_ranges, col_items])
            prev_bar = item
            subcell_col = []
    # Remove extra column before first bar
    return cols
210065
def _set(self, ctx, table_name, record_id, column_values):
        
        vsctl_table = self._get_table(table_name)
        ovsrec_row = ctx.must_get_row(vsctl_table, record_id)
        for column, value in column_values:
            ctx.set_column(ovsrec_row, column, value)
        ctx.invalidate_cache()
544920
def get_row(self, row_index):
    """"""
    if self._raw_rows is None:
      self._raw_rows = list(self.raw_sheet.rows())
    return self._raw_rows[row_index]
422352
def <<(row)
      if row == Border::SEPARATOR
        separators << columns_size - (header ? 0 : 2)
      else
        rows_copy = rows.dup
        assert_row_sizes rows_copy << row
        rows << to_row(row)
      end
      self
    end