Adds a row to ``table`` for ``varname``, in megabytes.
18242
def add_var_mb(table: PrettyTable,
               vardict: Dict[str, str],
               varname: str) -> None:
    
    valstr = vardict.get(varname, None)
    table.add_row([varname, val_mb(valstr), UNITS_MB])
1228206
def _insert_row(self, i, index):
        
        if i == len(self._index):
            self._add_row(index)
        else:
            self._index.insert(i, index)
            for c in range(len(self._columns)):
                self._data[c].insert(i, None)
695470
public final void addRow(Object... values) {
        assert(verifyTableInvariants());
        if (m_readOnly) {
            throw new IllegalStateException("Table is read-only. Make a copy before changing.");
        }
        if (m_colCount == 0) {
            throw new IllegalStateException("Table has no columns defined");
        }
        if (values.length != m_colCount) {
            throw new IllegalArgumentException(values.length + " arguments but table has " + m_colCount + " columns");
        }

        // memoize the start of this row in case we roll back
        final int pos = m_buffer.position();

        try {
            // Allow the buffer to grow to max capacity
            m_buffer.limit(m_buffer.capacity());
            // advance the row size value
            m_buffer.position(pos + 4);

            // where does the type bytes start
            // skip rowstart + status code + colcount
            int typePos = POS_COL_TYPES;

            for (int col = 0; col < m_colCount; col++) {
                Object value = values[col];
                VoltType columnType = VoltType.get(m_buffer.get(typePos + col));

                addColumnValue(value, columnType, col);
            }

            //
            // Note, there is some near-identical code in both row add methods.
            // [ add(..) and addRow(..) ]
            // If you change code below here, change it in the other method too.
            // (It would be nice to re-factor, but I couldn't make a clean go at
            //  it quickly - Hugg)
            //

            final int rowsize = m_buffer.position() - pos - 4;
            assert(rowsize >= 0);

            // check for too big rows
            if (rowsize > VoltTableRow.MAX_TUPLE_LENGTH) {
                throw new VoltOverflowException(
                        "Table row total length larger than allowed max " + VoltTableRow.MAX_TUPLE_LENGTH_STR);
            }

            // buffer overflow is caught and handled below.
            m_buffer.putInt(pos, rowsize);

            m_rowCount++;
            m_buffer.putInt(m_rowStart, m_rowCount);
        }
        catch (VoltTypeException vte) {
            // revert the row size advance and any other
            // buffer additions
            m_buffer.position(pos);
            throw vte;
        }
        catch (BufferOverflowException e) {
            m_buffer.position(pos);
            expandBuffer();
            addRow(values);
        }
        // row was too big, reset and rethrow
        catch (VoltOverflowException e) {
            m_buffer.position(pos);
            throw e;
        }
        catch (IllegalArgumentException e) {
            m_buffer.position(pos);
            // if this was thrown because of a lack of space
            // then grow the buffer
            // the number 32 was picked out of a hat ( maybe a bug if str > 32 )
            if (m_buffer.limit() - m_buffer.position() < 32) {
                expandBuffer();
                addRow(values);
            } else {
                throw e;
            }
        }
        finally {
            // constrain buffer limit back to the new position
            m_buffer.limit(m_buffer.position());
        }

        assert(verifyTableInvariants());
    }
1349377
public void addRow(String key, String value, String state, int color) {

        String[] row = new String[4];

        if (value == null) {
            value = "";
        }

        row[0] = key;
        row[1] = value;
        row[2] = state;    // null / "-" / "+"
        row[3] = String.valueOf(color);

        vData.addElement(row);

        int len = fMetrics.stringWidth(value);

        if (len > iMaxTextLength) {
            iMaxTextLength = len;
        }

        iRowCount++;
    }
949414
def add_row(row)
      size = row.size
      raise ArgumentError.new("Given a row of data with #{size} entries, but there are only #{@table_columns.size} columns in the table") unless size == @table_columns.size
      @data << row
    end
649801
def _insert_row(self, i, index):
        
        if i == len(self._index):
            self._add_row(index)
        else:
            self._index.insert(i, index)
            self._data.insert(i, None)
348427
def _SetRow(self, new_values, row=0):
        

        if not row:
            row = self._row_index

        if row > self.size:
            raise TableError("Entry %s beyond table size %s." % (row, self.size))

        self._table[row].values = new_values
1333696
def smartAppend(table,name,value):
     
    if name not in list(table.keys()):
        table[name] = []
    table[name].append(value)
1251822
def appendRow(self, *args, **kwargs):
		
		row = self.RowType(*args, **kwargs)
		self.append(row)
		return row
584733
public final void add(VoltTableRow row) {
        assert(verifyTableInvariants());
        if (m_readOnly) {
            throw new IllegalStateException("Table is read-only. Make a copy before changing.");
        }
        if (m_colCount == 0) {
            throw new IllegalStateException("Table has no columns defined");
        }
        if (row.getColumnCount() != m_colCount) {
            throw new IllegalArgumentException(row.getColumnCount() + " arguments but table has " + m_colCount + " columns");
        }

        // memoize the start of this row in case we roll back
        final int pos = m_buffer.position();

        try {
            // Allow the buffer to grow to max capacity
            m_buffer.limit(m_buffer.capacity());

            byte[] inboundSchemaString = row.getSchemaString();
            byte[] mySchemaString = getSchemaString();

            // The way this works is that when two schema strings are found to have
            // the same value, the target table's reference is pointed at the source
            // table's reference. This allows the copying of multiple rows from one
            // table to another to only do a deep comparison once, and to do reference
            // equivalence checks for subsequent rows.
            boolean canDoRawCopy = (inboundSchemaString == mySchemaString) ||
                    Arrays.equals(inboundSchemaString, mySchemaString);

            if (canDoRawCopy) {
                // make them the same object if equal for faster comparison next time
                m_schemaString = inboundSchemaString;

                // raw blit the row (assume the row is valid with proper length)
                ByteBuffer rawRow = row.getRawRow();
                m_buffer.put(rawRow);
            }
            else {
                // advance the row size value
                m_buffer.position(pos + 4);

                for (int i = 0; i < m_colCount; i++) {
                    VoltType inboundType = row.getColumnType(i);
                    VoltType outboundType = getColumnType(i);

                    if (inboundType == outboundType) {
                        byte[] raw = row.getRaw(i);
                        m_buffer.put(raw);
                    }
                    else {
                        Object inboundValue = row.get(i, inboundType);
                        addColumnValue(inboundValue, outboundType, i);
                    }
                }

                final int rowsize = m_buffer.position() - pos - 4;
                assert(rowsize >= 0);

                // check for too big rows
                if (rowsize > VoltTableRow.MAX_TUPLE_LENGTH) {
                    throw new VoltOverflowException(
                            "Table row total length larger than allowed max " + VoltTableRow.MAX_TUPLE_LENGTH_STR);
                }

                // buffer overflow is caught and handled below.
                m_buffer.putInt(pos, rowsize);
            }

            // constrain buffer limit back to the new position
            m_buffer.limit(m_buffer.position());

            // increment the rowcount in the member var and in the buffer
            m_rowCount++;
            m_buffer.putInt(m_rowStart, m_rowCount);
        }
        catch (VoltTypeException vte) {
            // revert the row size advance and any other
            // buffer additions
            m_buffer.position(pos);
            throw vte;
        }
        catch (BufferOverflowException e) {
            m_buffer.position(pos);
            expandBuffer();
            add(row);
        }
        // row was too big, reset and rethrow
        catch (VoltOverflowException e) {
            m_buffer.position(pos);
            throw e;
        }
        catch (IllegalArgumentException e) {
            // if this was thrown because of a lack of space
            // then grow the buffer
            // the number 32 was picked out of a hat ( maybe a bug if str > 32 )
            if (m_buffer.limit() - m_buffer.position() < 32) {
                m_buffer.position(pos);
                expandBuffer();
                add(row);
            } else {
                throw e;
            }
        }
        assert(verifyTableInvariants());
    }
523093
def add_row(self, data: list=None):
        
        # validation
        if self.headers and data:
            if len(self.headers) != len(data):
                raise ValueError

        offset = 0 if not self.headers else 1
        row = list()

        if data:
            for i, element in enumerate(data):
                contents = '' if element is None else str(element)
                entry = ttk.Entry(self)
                entry.insert(0, contents)
                entry.grid(row=len(self._rows) + offset,
                           column=i,
                           sticky='E,W')
                row.append(entry)
        else:
            for i in range(self.num_of_columns):
                entry = ttk.Entry(self)
                entry.grid(row=len(self._rows) + offset,
                           column=i,
                           sticky='E,W')
                row.append(entry)

        self._rows.append(row)

        # clear all bindings
        for row in self._rows:
            for widget in row:
                widget.unbind('<Tab>')

        def add(e):
            self.add_row()

        last_entry = self._rows[-1][-1]
        last_entry.bind('<Tab>', add)

        e = self._rows[-1][0]
        e.focus_set()

        self._redraw()
577076
def add_rows(self, rows, header=True):
        

        # nb: don't use 'iter' on by-dimensional arrays, to get a
        #     usable code for python 2.1
        if header:
            if hasattr(rows, '__iter__') and hasattr(rows, 'next'):
                self.header(rows.next())
            else:
                self.header(rows[0])
                rows = rows[1:]
        for row in rows:
            self.add_row(row)
        return self
592221
def add_table(self, name, columns, type_map=None, if_not_exists=False):
        """"""
        # Check types mapping #
        if type_map is None and isinstance(columns, dict): types = columns
        if type_map is None:                               types = {}
        # Safe or unsafe #
        if if_not_exists: query = 'CREATE TABLE IF NOT EXISTS "%s" (%s);'
        else:             query = 'CREATE table "%s" (%s);'
        # Do it #
        cols = ','.join(['"' + c + '"' + ' ' + types.get(c, 'text') for c in columns])
        self.own_cursor.execute(query % (self.main_table, cols))
453502
def row_append(self, row_key, value_list):
        
        if row_key in self._row_keys:
            raise KeyError('Key %s already exists in row keys.' % row_key)
        if not len(value_list) == len(self._col_keys):
            raise ValueError('Length of data to set does not meet expected row length of %i' % len(self._col_keys))
        self._row_keys.append(row_key)
        for c, v in zip(self._col_keys, value_list):
            self[row_key, c] = v
545078
def row2table(soup, table, row):
    """"""
    tr = Tag(soup, name="tr")
    table.append(tr)
    for attr in row:
        td = Tag(soup, name="td")
        tr.append(td)
        td.append(attr)
388510
def Insert(self, key, value, row_index):
        
        if row_index < 0:
            row_index += len(self)

        if not 0 <= row_index < len(self):
            raise IndexError('Index "%s" is out of bounds.' % row_index)

        new_row = Row()
        for idx in self.header:
            if self.index(idx) == row_index:
                new_row[key] = value
            new_row[idx] = self[idx]
        self._keys = new_row.header
        self._values = new_row.values
        del new_row
        self._BuildIndex()
88106
def friend_addRow(self, rowNum, row):
                """"""
                self[rowNum] = row
                if (rowNum > self.maxRow):
                        self.maxRow = rowNum

                for cellNum in row.keys():
                        if cellNum > self.maxColumn:
                                self.maxColumn = cellNum

                return row.friend_Finalize()