return a dictionary of {(row, col) -> CellStyle}
        for all cells that use a non-default style.
161975
def _get_all_styles(self):
        
        _styles = {}
        def _get_style(bold=False, bg_col=None, border=None):
            if (bold, bg_col, border) not in _styles:
                _styles[(bold, bg_col, border)] = CellStyle(bold=bold,
                                                            bg_color=bg_col,
                                                            border=border)
            return _styles[(bold, bg_col, border)]

        ws_styles = {}
        for table, (row, col) in self.__tables.values():
            for r in range(row, row + table.header_height):
                for c in range(col, col + table.width):
                    if isinstance(table.header_style, dict):
                        col_name = table.dataframe.columns[c - col]
                        style = table.header_style.get(col_name, _get_style(bold=True))
                    else:
                        style = table.header_style or _get_style(bold=True)
                    ws_styles[(r, c)] = style

            for c in range(col, col + table.row_labels_width):
                for r in range(row + table.header_height, row + table.height):
                    if isinstance(table.index_style, dict):
                        row_name = table.dataframe.index[r - row]
                        style = table.index_style.get(row_name, _get_style(bold=True))
                    else:
                        style = table.index_style or _get_style(bold=True)
                    ws_styles[(r, c)] = style

            if table.style.stripe_colors or table.style.border:
                num_bg_cols = len(table.style.stripe_colors) if \
                    table.style.stripe_colors else 1
                bg_cols = table.style.stripe_colors if \
                    table.style.stripe_colors else None

                for i, row_offset in enumerate(range(table.header_height,
                                                     table.height)):
                    for c in range(col, col + table.width):
                        bg_col = bg_cols[i % num_bg_cols] if bg_cols else None
                        style = _get_style(bold=None, bg_col=bg_col, border=table.style.border)
                        if (row + row_offset, c) in ws_styles:
                            style = style + ws_styles[(row + row_offset, c)]
                        ws_styles[(row + row_offset, c)] = style

            for col_name, col_style in table.column_styles.items():
                try:
                    col_offset = table.get_column_offset(col_name)
                except KeyError:
                    continue
                for i, r in enumerate(range(row + table.header_height, row + table.height)):
                    style = col_style
                    if (r, col + col_offset) in ws_styles:
                        style = ws_styles[(r, col + col_offset)] + style
                    ws_styles[(r, col + col_offset)] = style

            for row_name, row_style in table.row_styles.items():
                try:
                    row_offset = table.get_row_offset(row_name)
                except KeyError:
                    continue
                for i, c in enumerate(range(col + table.row_labels_width, col + table.width)):
                    style = row_style
                    if (row + row_offset, c) in ws_styles:
                        style = ws_styles[(row + row_offset, c)] + style
                    ws_styles[(row + row_offset, c)] = style

            for (row_name, col_name), cell_style in table.cell_styles.items():
                try:
                    col_offset = table.get_column_offset(col_name)
                    row_offset = table.get_row_offset(row_name)
                except KeyError:
                    continue
                style = cell_style
                if (row + row_offset, col + col_offset) in ws_styles:
                    style = ws_styles[(row + row_offset, col + col_offset)] + style
                ws_styles[(row + row_offset, col + col_offset)] = style

        for (row, col), value in self.__values.items():
            if isinstance(value, Value):
                style = value.style
                if style:
                    if (row, col) in ws_styles:
                        style = style + ws_styles[(row, col)]
                    ws_styles[(row, col)] = style

        return ws_styles
954123
def add_style(cell_ref, *styles)
      item = self[cell_ref]
      cells = item.is_a?(Array) ? item : [item]
      cells.each do |cell|
        styles.each do |style|
          cell.add_style(style)
        end
      end
    end
1118236
def font(row, col, sheet = nil)
      key = normalize(row, col)
      definition_index = safe_send(sheet_for(sheet).cells[key], :style)
      styles.definitions[definition_index] if definition_index
    end
1305453
def col_widths(self):
        # type: () -> defaultdict
        
        _widths = defaultdict(int)

        all_rows = [self.headers]
        all_rows.extend(self._rows)

        for row in all_rows:
            for idx, col in enumerate(row):
                _col_l = len(col)
                if _col_l > _widths[idx]:
                    _widths[idx] = _col_l

        return _widths
821606
def list_styles(style_name):
    
    style = get_style_by_name(style_name)

    keys = list(style)[0][1]
    Styles = namedtuple("Style", keys)

    existing_styles = {}

    for ttype, ndef in style:
        s = Styles(**ndef)
        if s in existing_styles:
            existing_styles[s].append(ttype)
        else:
            existing_styles[s] = [ttype]

    for ndef, ttypes in existing_styles.items():
        print(ndef)
        for ttype in sorted(ttypes):
            print("\t%s" % str(ttype).split("Token.",1)[1])
1016067
def auto_style(self):
        
        if self._row_size is None:
            return
        elif self._row_size == 3:
            self.set_cols_align(['l', 'l', 'l'])
            self.set_cols_valign(['t', 't', 't'])
            self.set_cols_width([12, 54, 12])
        elif self._row_size == 4:
            self.set_cols_align(['l', 'l', 'l', 'l'])
            self.set_cols_valign(['t', 't', 't', 't'])
            self.set_cols_width([10, 40, 10, 10])
36030
def dict_factory(cursor, row):
    
    out = {}
    for i, col in enumerate(cursor.description):
        out[col[0]] = row[i]
    return out
599609
def styles(self, dictobj):
		
		for k in dictobj:
			self.chart_style[k] = dictobj[k]
886057
def rows_to_dicts(self, serialize_cell=None):
    """"""
    if serialize_cell is None:
      serialize_cell = self.get_cell_value
    # keys = [serialize_cell(cell) for cell in self.rows[0]]
    keys = self.headers(serialize_cell)
    for row in self.rows[1:]:
      yield dict(zip(keys, [serialize_cell(cell) for cell in row]))
975642
def get_tr(self):
        """"""

        cell_above = CellBorders(self.cell_attributes,
                                 *self.cell.get_above_key_rect())
        return cell_above.get_r()
542946
function convertStyleToRules( style ) {
		var styleDef = style.getDefinition(),
			rules = {},
			rule,
			attrs = styleDef.attributes;

		rules[ styleDef.element ] = rule = {
			styles: styleDef.styles,
			requiredStyles: styleDef.styles && CKEDITOR.tools.objectKeys( styleDef.styles )
		};

		if ( attrs ) {
			attrs = copy( attrs );
			rule.classes = attrs[ 'class' ] ? attrs[ 'class' ].split( /\s+/ ) : null;
			rule.requiredClasses = rule.classes;
			delete attrs[ 'class' ];
			rule.attributes = attrs;
			rule.requiredAttributes = attrs && CKEDITOR.tools.objectKeys( attrs );
		}

		return rules;
	}
855090
def _apply_style_colors(self, colors, kwds, col_num, label):
        
        style = None
        if self.style is not None:
            if isinstance(self.style, list):
                try:
                    style = self.style[col_num]
                except IndexError:
                    pass
            elif isinstance(self.style, dict):
                style = self.style.get(label, style)
            else:
                style = self.style

        has_color = 'color' in kwds or self.colormap is not None
        nocolor_style = style is None or re.match('[a-z]+', style) is None
        if (has_color or self.subplots) and nocolor_style:
            kwds['color'] = colors[col_num % len(colors)]
        return style, kwds
14026
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'fonts') and self.fonts is not None:
            _dict['fonts'] = [x._to_dict() for x in self.fonts]
        if hasattr(self, 'styles') and self.styles is not None:
            _dict['styles'] = [x._to_dict() for x in self.styles]
        return _dict
1344260
def font(row, col, sheet = nil)
      sheet ||= default_sheet
      read_cells(sheet)
      row, col   = normalize(row, col)
      style_name = @style[sheet][[row, col]] || @style_defaults[sheet][col - 1] || 'Default'
      @font_style_definitions[style_name]
    end
928536
def cell(self, rowName, columnName):
        
        return self.matrix[self.rowIndices[rowName], self.columnIndices[columnName]]
1168641
function styleRows(selection, self) {
    selection
      .classed(style.row, true)
      .style('height', `${self.rowHeight}px`)
      .style(
        transformCSSProp,
        (d, i) => `translate3d(0,${d.key * self.rowHeight}px,0)`
      );
  }
1084176
def row(self, columnnames=[], exclude=False):
        
        from .tablerow import tablerow
        return tablerow(self, columnnames, exclude)