Return an iterator of rows ready to insert into table "nodes".

    * rows - iterator of lists (eg, output from read_archive or read_dmp)
761037
def read_nodes(rows, source_id=1):
    

    ncbi_keys = ['tax_id', 'parent_id', 'rank', 'embl_code', 'division_id']
    extra_keys = ['source_id', 'is_valid']
    is_valid = True

    ncbi_cols = len(ncbi_keys)

    rank = ncbi_keys.index('rank')
    parent_id = ncbi_keys.index('parent_id')

    # assumes the first row is the root
    row = next(rows)
    row[rank] = 'root'
    # parent must be None for termination of recursive CTE for
    # calculating lineages
    row[parent_id] = None
    rows = itertools.chain([row], rows)

    yield ncbi_keys + extra_keys

    for row in rows:
        # replace whitespace in "rank" with underscore
        row[rank] = '_'.join(row[rank].split())
        # provide default values for source_id and is_valid
        yield row[:ncbi_cols] + [source_id, is_valid]
1373529
def readrows(self):
        
        # Calling the internal _readrows so we can catch issues/log rotations
        reconnecting = True
        while True:
            # Yield the rows from the internal reader
            try:
                for row in self._readrows():
                    if reconnecting:
                        print('Successfully monitoring {:s}...'.format(self._filepath))
                        reconnecting = False
                    yield row
            except IOError:
                # If the tail option is set then we do a retry (might just be a log rotation)
                if self._tail:
                    print('Could not open file {:s} Retrying...'.format(self._filepath))
                    reconnecting = True
                    time.sleep(5)
                    continue
                else:
                    break

            # If the tail option is set then we do a retry (might just be a log rotation)
            if self._tail:
                print('File closed {:s} Retrying...'.format(self._filepath))
                reconnecting = True
                time.sleep(5)
                continue
            else:
                break
483156
def get_rows(self):
        
        rows = []
        if check_table_exists(self.tracker.dbcon_master, self.name):
            rows.extend(get_rows(self.tracker.dbcon_master, self.name))
        if self.tracker.dbcon_part and check_table_exists(self.tracker.dbcon_part, self.name):
            rows.extend(get_rows(self.tracker.dbcon_part, self.name))
        return rows
477161
def prepare_data(self, rows):
        
        self._rows = dict()
        for row in copy.copy(rows) if self.copy else rows:
            pseudo_key = self._get_pseudo_key(row)
            if pseudo_key not in self._rows:
                self._rows[pseudo_key] = list()
            self._rows[pseudo_key].append(row)

        # Convert begin and end dates to integers.
        self._date_type = None
        for pseudo_key, rows in self._rows.items():
            self._rows_date2int(rows)
282524
def annotation_rows(prefix, annotations):
    
    ncol = len(annotations['Column Name'])
    return {name.replace(prefix, '', 1) : values + [''] * (ncol - len(values))
            for name, values in annotations.items() if name.startswith(prefix)}
831364
def rows(self) -> List[List[str]]:
        
        return [list(d.values()) for d in self.data]
483497
async def fetchall(self):
        
        rows = []
        while True:
            row = await self.fetchone()
            if row is None:
                break
            rows.append(row)
        return rows
807761
def _insert(self, tree):
        
        tablename = tree.table
        count = 0
        kwargs = {}
        batch = self.connection.batch_write(tablename, **kwargs)
        with batch:
            for item in iter_insert_items(tree):
                batch.put(item)
                count += 1
        return count
972156
def generate_table(self, rows):
        
        table = PrettyTable(**self.kwargs)
        for row in self.rows:
            if len(row[0]) < self.max_row_width:
                appends = self.max_row_width - len(row[0])
                for i in range(1, appends):
                    row[0].append("-")

            if row[1] is True:
                self.make_fields_unique(row[0])
                table.field_names = row[0]
            else:
                table.add_row(row[0])
        return table
461350
def get_rows(self):
        
        try:
            rows = []
            if self.formset_class is None:
                formset = []
            else:
                formset = self.get_formset()
                formset.is_valid()
            for datum, form in six.moves.zip_longest(self.filtered_data,
                                                     formset):
                row = self._meta.row_class(self, datum, form)
                if self.get_object_id(datum) == self.current_item_id:
                    self.selected = True
                    row.classes.append('current_selected')
                rows.append(row)
        except Exception:
            # Exceptions can be swallowed at the template level here,
            # re-raising as a TemplateSyntaxError makes them visible.
            LOG.exception("Error while rendering table rows.")
            exc_info = sys.exc_info()
            raise six.reraise(template.TemplateSyntaxError, exc_info[1],
                              exc_info[2])
        return rows
1173510
def rows(self):
        
        with self.input().open('r') as fobj:
            for line in fobj:
                yield line.strip('\n').split('\t')
1020972
def add_rows(self, list_of_rows):
        """"""
        for row in list_of_rows:
            self.row_deque.append(row)
            self.time_deque.append(time.time())
        # Update the data structure
        self.update()
201536
@InterfaceAudience.Public
    public QueryEnumerator getRows() {
        start();
        if (rows == null) {
            return null;
        }
        else {
            // Have to return a copy because the enumeration has to start at item #0 every time
            return new QueryEnumerator(rows);
        }
    }
471697
def table_columns(self):
        ''''''
        with self.conn.cursor() as cur:
            cur.execute(self.TABLE_COLUMNS_QUERY % self.database)
            for row in cur:
                yield row
550289
def get_selected_rows(self):
        

        rows, model = super(TreeSelection, self).get_selected_rows()
        return (model, rows)
776219
def table(self):
        """"""
        if self._table is None:
            self._table = list(self._iter_rows())

        return self._table
89584
def node_to_row node
      crow = nil
      @list.each_with_index { |e,i| 
        if e == node
          crow = i
          break
        end
      }
      crow
    end