A Tablib Dataset containing the row.
343264
def dataset(self):
        """"""
        data = tablib.Dataset()
        data.headers = self.keys()

        row = _reduce_datetimes(self.values())
        data.append(row)

        return data
992847
def _GetRow(self, columns=None):
        """"""

        row = self._table[self._row_index]
        if columns:
            result = []
            for col in columns:
                if col not in self.header:
                    raise TableError("Column header %s not known in table." % col)
                result.append(row[self.header.index(col)])
            row = result
        return row
420776
def _tabulate(rows, headers, spacing=5):
    """"""
    if len(rows) == 0:
        return "None\n"
    assert len(rows[0]) == len(headers)
    count = len(rows[0])
    widths = [0 for _ in range(count)]
    rows = [headers] + rows

    for row in rows:
        for index, field in enumerate(row):
            if len(str(field)) > widths[index]:
                widths[index] = len(str(field))

    output = ""
    for row in rows:
        for index, field in enumerate(row):
            field = str(field)
            output += field + (widths[index] - len(field) + spacing) * " "
        output += "\n"
    return output
265735
def tabulate(self, format='html', syntax=''):

    '''
        
    '''

    from tabulate import tabulate as _tabulate
    
# define headers
    headers = ['Field', 'Datatype', 'Required', 'Default', 'Examples', 'Conditionals', 'Description']
    rows = []
    default_values = False
    additional_conditions = False
    field_description = False

# construct rows
    for key, value in self.keyMap.items():

        key_segments = _segment_path(key)

        if key_segments:

            row = []

        # add field column
            field_name = ''
            if len(key_segments) > 1:
                for i in range(1,len(key_segments)):
                    field_name += '&nbsp;&nbsp;&nbsp;&nbsp;'
            if key_segments[-1] == '0':
                field_name += '<i>item</i>'
            else:
                field_name += key_segments[-1]
            row.append(field_name)

        # add datatype column
            value_datatype = value['value_datatype']
            if 'integer_data' in value.keys():
                if value['integer_data'] and syntax != 'javascript':
                    value_datatype = 'integer'
            elif value['value_datatype'] == 'map':
                if syntax == 'javascript':
                    value_datatype = 'object'
            elif value['value_datatype'] == 'list':
                if syntax == 'javascript':
                    value_datatype = 'array'
            # retrieve datatype of item in list
                item_key = key + '[0]'
                item_datatype = self.keyMap[item_key]['value_datatype']
                if syntax == 'javascript':
                    if item_datatype == 'list':
                        item_datatype = 'array'
                    elif item_datatype == 'map':
                        item_datatype = 'object'
                elif 'integer_data' in self.keyMap[item_key].keys():
                    if self.keyMap[item_key]['integer_data']:
                        item_datatype = 'integer'
                value_datatype += ' of %ss' % item_datatype
            row.append(value_datatype)

        # add required column
            if value['required_field']:
                row.append('yes')
            else:
                row.append('')

        # add default column
            if 'default_value' in value.keys():
                default_values = True
                if isinstance(value['default_value'], str):
                    row.append('"%s"' % value['default_value'])
                elif isinstance(value['default_value'], bool):
                    row.append(str(value['default_value']).lower())
                else:
                    row.append(str(value['default_value']))
            else:
                row.append('')

        # define recursive example constructor
            def determine_example(k, v):
                example_value = ''
                if 'example_values' in v.keys():
                    for i in v['example_values']:
                        if example_value:
                            example_value += ', '
                        if isinstance(i, str):
                            example_value += '"%s"' % i
                        else:
                            example_value += value
                elif 'declared_value' in v.keys():
                    if isinstance(v['declared_value'], str):
                        example_value = '"%s"' % v['declared_value']
                    elif isinstance(v['declared_value'], bool):
                        example_value = str(v['declared_value']).lower()
                    else:
                        example_value = v['declared_value']
                else:
                    if v['value_datatype'] == 'map':
                        example_value = '{...}'
                    elif v['value_datatype'] == 'list':
                        example_value = '[...]'
                    elif v['value_datatype'] == 'null':
                        example_value = 'null'
                return example_value

        # add examples column
            row.append(determine_example(key, value))

        # add additional conditions
            conditions = ''
            description = ''
            for k, v in value.items():
                extra_integer = False
                if k == 'integer_data' and syntax == 'javascript':
                    extra_integer = True
                if k not in ('example_values', 'value_datatype', 'required_field', 'declared_value', 'default_value', 'field_position', 'field_metadata') or extra_integer:
                    add_extra = False
                    if k == 'extra_fields':
                        if v:
                            add_extra = True
                    if k in ('field_description', 'field_title'):
                        field_description = True
                        if k == 'field_description':
                            description = v
                        elif not description:
                            description = v
                    elif k != 'extra_fields' or add_extra:
                        additional_conditions = True
                        if conditions:
                            conditions += '<br>'
                        condition_value = v
                        if isinstance(v, str):
                            condition_value = '"%s"' % v
                        elif isinstance(v, bool):
                            condition_value = str(v).lower()
                        conditions += '%s: %s' % (k, condition_value)
            row.append(conditions)
            row.append(description)

        # add row to rows
            rows.append(row)

# add rows for top field
    top_dict = self.keyMap['.']
    if top_dict['extra_fields']:
        rows.append(['<i>**extra fields allowed</i>', '', '', '', '', '', ''])
    if 'max_bytes' in top_dict.keys():
        rows.append(['<i>**max bytes: %s</i>' % top_dict['max_bytes'], '', '', '', '', '', ''])

# eliminate unused columns
    if not field_description:
        headers.pop()
    if not additional_conditions:
        headers.pop()
    if not default_values:
        headers.pop(3)
    for row in rows:
        if not field_description:
            row.pop()
        if not additional_conditions:
            row.pop()
        if not default_values:
            row.pop(3)

# construct table html
    table_html = _tabulate(rows, headers, tablefmt='html')

# add links to urls in text
    # markdown_url = re.compile('\[(.*?)\]\((.*)\)')
    table_html = _add_links(table_html)

    return table_html
657593
def rowget(self,tables_dict,row_list,index):
    ""
    tmp=row_list
    for i in self.index_tuple(tables_dict,index,False): tmp=tmp[i]
    return tmp
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]
693022
def display_rows(self,
                     rows,
                     labels,
                     indent):

        ''''''

        out = []

        if not rows:
            return out

        first_row_type = type(rows[0])
        # all rows must have the same datatype
        consistent = True
        for row in rows[1:]:
            if type(row) != first_row_type:
                consistent = False

        if not consistent:
            return out

        if isinstance(labels, dict):
            labels_temp = []
            for key in sorted(labels):
                labels_temp.append(labels[key])
            labels = labels_temp

        if first_row_type is dict:  # and all the others
            temp_rows = []
            if not labels:
                labels = [six.text_type(label).replace('_', ' ').title() for label in sorted(rows[0])]
            for row in rows:
                temp_row = []
                for key in sorted(row):
                    temp_row.append(six.text_type(row[key]))
                temp_rows.append(temp_row)
            rows = temp_rows
        elif isinstance(rows[0], six.string_types):
            rows = [[row] for row in rows]  # encapsulate each row in a single-element list

        labels_and_rows = [labels] + rows if labels else rows
        has_header = self.has_header and labels

        return self.prepare_rows(labels_and_rows, indent + 4, has_header)
544133
def iter_rows(self):
        
        fileobj = self._fileobj
        cls_row = self.cls_row
        fields = self.fields

        for idx in range(self.prolog.records_count):
            data = fileobj.read(1)

            marker = struct.unpack('<1s', data)[0]
            is_deleted = marker == b'*'

            if is_deleted:
                continue

            row_values = []
            for field in fields:
                val = field.cast(fileobj.read(field.len))
                row_values.append(val)

            yield cls_row(*row_values)
834497
def row_to_obj(self, row, cur):
        """"""
        obj = tornado.util.ObjectDict()
        for val, desc in zip(row, cur.description):
            obj[desc.name] = val
        return obj
776219
def table(self):
        """"""
        if self._table is None:
            self._table = list(self._iter_rows())

        return self._table
1021728
def prepare_rows(self,
                     rows,
                     indent,
                     has_header):

        ''''''

        out = []

        def row_wrapper(row):
            new_rows = [
                self.wrapfunc(item).split('\n')
                for item in row
            ]
            rows = []
            for item in map(lambda *args: args, *new_rows):
                if isinstance(item, (tuple, list)):
                    rows.append([substr or '' for substr in item])
                else:
                    rows.append([item])
            return rows

        logical_rows = [
            row_wrapper(row)
            for row in rows
        ]

        columns = map(lambda *args: args, *reduce(operator.add, logical_rows))

        max_widths = [
            max([len(six.text_type(item)) for item in column])
            for column in columns
        ]
        row_separator = self.row_delimiter * (len(self.prefix) + len(self.suffix) + sum(max_widths) +
                                              len(self.delim) * (len(max_widths) - 1))

        justify = self._JUSTIFY_MAP[self.justify.lower()]

        if self.separate_rows:
            out.append(
                self.ustring(
                    indent,
                    self.LIGHT_GRAY,  # pylint: disable=no-member
                    row_separator
                )
            )
        for physical_rows in logical_rows:
            for row in physical_rows:
                line = self.prefix \
                        + self.delim.join([
                                justify(six.text_type(item), width)
                                for (item, width) in zip(row, max_widths)
                        ]) + self.suffix
                out.append(
                    self.ustring(
                        indent,
                        self.WHITE,  # pylint: disable=no-member
                        line
                    )
                )
            if self.separate_rows or has_header:
                out.append(
                    self.ustring(
                        indent,
                        self.LIGHT_GRAY,  # pylint: disable=no-member
                        row_separator
                    )
                )
                has_header = False
        return out
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)
495880
private RowSet prepareFromRow(List<Object> rows, RowSet rowSet) throws Exception {
    for (Object row : rows) {
      rowSet.addRow((Object[]) row);
    }
    return rowSet;
  }
187671
def row(self, fields):
        """"""

        d = self.dict

        row = [None] * len(fields)

        for i, f in enumerate(fields):
            if f in d:
                row[i] = d[f]

        return row
1184000
def dataset(db=nil)
      db ||= self.class.default_db
      builder = Database::DatasetBuilder.new(db, self)
      builder.select(@columns)
      builder.filter(@filters)
      builder.order(@order)
      builder.limit(@limit) if @limit
      builder.dataset
    end
503505
def iterboxed(self, rows):
        
        def asvalues(raw):
            """
            Convert a row of raw bytes into a flat row.

            Result may or may not share with argument
            """
            if self.bitdepth == 8:
                return raw
            if self.bitdepth == 16:
                raw = bytearray_to_bytes(raw)
                return array('H', struct.unpack('!%dH' % (len(raw) // 2), raw))
            assert self.bitdepth < 8
            width = self.width
            # Samples per byte
            spb = 8 // self.bitdepth
            out = newBarray()
            mask = 2 ** self.bitdepth - 1
            #                                      reversed range(spb)
            shifts = [self.bitdepth * it for it in range(spb - 1, -1, -1)]
            for o in raw:
                out.extend([mask & (o >> i) for i in shifts])
            return out[:width]

        return map(asvalues, rows)
933347
def make_row_dict(row):
    
    ind = row[row.notnull()].index
    values = row[row.notnull()].values
    # to transformation with extract_col_name here???
    return dict(list(zip(ind, values)))