Computes the width of a model and sets up appropriate padding
    for Tabs and DataTable types.
355475
def pad_width(model, table_padding=0.85, tabs_padding=1.2):
    
    if isinstance(model, Row):
        vals = [pad_width(child) for child in model.children]
        width = np.max([v for v in vals if v is not None])
    elif isinstance(model, Column):
        vals = [pad_width(child) for child in model.children]
        width = np.sum([v for v in vals if v is not None])
    elif isinstance(model, Tabs):
        vals = [pad_width(t) for t in model.tabs]
        width = np.max([v for v in vals if v is not None])
        for model in model.tabs:
            model.width = width
            width = int(tabs_padding*width)
    elif isinstance(model, DataTable):
        width = model.width
        model.width = int(table_padding*width)
    elif isinstance(model, (WidgetBox, Div)):
        width = model.width
    elif model:
        width = model.plot_width
    else:
        width = 0
    return width
440892
def _layout(self):
        """"""

        self.EnableGridLines(False)

        # Standard row and col sizes for zooming
        default_cell_attributes = \
            self.code_array.cell_attributes.default_cell_attributes

        self.std_row_size = default_cell_attributes["row-height"]
        self.std_col_size = default_cell_attributes["column-width"]

        self.SetDefaultRowSize(self.std_row_size)
        self.SetDefaultColSize(self.std_col_size)

        # Standard row and col label sizes for zooming
        self.col_label_size = self.GetColLabelSize()
        self.row_label_size = self.GetRowLabelSize()

        self.SetRowMinimalAcceptableHeight(1)
        self.SetColMinimalAcceptableWidth(1)

        self.SetCellHighlightPenWidth(0)
409041
def auto_adjust_widths
      column_widths = []

      rows.each do |row|
        row.columns.each_with_index do |col, i|
          column_widths[i] = [col.required_width, (column_widths[i] || 0)].max
        end
      end

      rows.each do |row|
        row.columns.each_with_index do |col, i|
          col.width = column_widths[i]
        end
      end
    end
1070060
def _updateTabStopWidth(self):
        
        self.setTabStopWidth(self.fontMetrics().width(' ' * self._indenter.width))
1113055
public void widthTable(XWPFTable table, float widthCM, int rows, int cols) {
        TableTools.widthTable(table, widthCM, cols);
        TableTools.borderTable(table, 4);
    }
414381
def get_widths(self, estimation):
        
        widths = estimation[self.map_offset[1]:self.map_offset[2]]\
            .reshape(self.K, 1)
        return widths
1171095
void updateWidth() {

        if (formCss().firstColumn().equals(m_compacteModeStyle.getValue())) {
            int width = getElement().getParentElement().getOffsetWidth() - formCss().SECOND_COLUMN_WIDTH();
            // if width could not be evaluated, fall back to a 'save' value
            if (width < 0) {
                width = 400;
            }
            getElement().getStyle().setWidth(width, Unit.PX);
        } else {
            getElement().getStyle().clearWidth();
        }
    }
692194
private void set_data_size()
	{
		switch(data_format.value())
		{
		case AttrDataFormat._SCALAR :
			data_size = 1;
			break;
		
		case AttrDataFormat._SPECTRUM :
			data_size = dim_x;
			break;
		
		case AttrDataFormat._IMAGE :
			data_size = dim_x * dim_y;
			break;
		}
	}
424352
def width
      @width ||= list.map { |t| t.name_with_args ? t.name_with_args.length : 0 }.max || 10
    end
935586
def set_content_type_and_size_in_model
      model.content_type = file.content_type if file.content_type
      model.file_size = file.size
    end
245086
public void setColumnWidth(int width)
    {
        content = new Dimension(0, 0);
        content.width = width;
        bounds.width = content.width;
    }
400162
public void setWidth(double width) {
        switch (type) {
            case BOX:
                box.setWidth(width);
                box.setDepth(width);
                break;
            case CYLINDER:
                cylinder.setRadius(width * 0.5);
                break;
            default:
                break;
        }
    }
842337
protected void calculateBounds(float _Width, float _Margin) {
        float maxValue = 0;
        int   last     = 0;

        for (BarModel model : mData) {
            if(model.getValue() > maxValue) {
                maxValue = model.getValue();
            }
        }

        int valuePadding = mShowValues ? (int) mValuePaint.getTextSize() + mValueDistance : 0;

        float heightMultiplier = (mGraphHeight - valuePadding) / maxValue;

        for (BarModel model : mData) {
            float height = model.getValue() * heightMultiplier;
            last += _Margin / 2;
            model.setBarBounds(new RectF(last, mGraphHeight - height, last + _Width, mGraphHeight));
            model.setLegendBounds(new RectF(last, 0, last + _Width, mLegendHeight));
            last += _Width + (_Margin / 2);
        }

        Utils.calculateLegendInformation(mData, 0, mContentRect.width(), mLegendPaint);
    }
337713
def calculate_width_content(width, border = False, margin = None, margin_left = None, margin_right = None, padding = None, padding_left = None, padding_right = None):
        
        if margin_left is None:
            margin_left = margin
        if margin_right is None:
            margin_right = margin
        if margin_left is not None:
            width -= int(margin_left)
        if margin_right is not None:
            width -= int(margin_right)
        if padding_left is None:
            padding_left = padding
        if padding_right is None:
            padding_right = padding
        if padding_left is not None:
            width -= int(padding_left)
        if padding_right is not None:
            width -= int(padding_right)
        if border:
            width -= 2
        return width if width > 0 else None
1276306
def set_cols_width(self, array):
        

        self._check_row_size(array)
        try:
            array = map(int, array)
            if reduce(min, array) <= 0:
                raise ValueError
        except ValueError:
            sys.stderr.write("Wrong argument in column width specification\n")
            raise
        self._width = array
391292
def column_width(self, width):
        """"""
        if isinstance(width, int):
            if width >= 0:
                self._column_width = width
            else:
                raise ValueError('Column width must be nonnegative.')
        else:
            raise TypeError('Column width must be a nonnegative integer.')
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