Calculate the maximum padding width for a set of lines.

@return int
963507
private function getMaxWidth()
    {
        $max = 0;

        foreach ($this->getOptions() as $option) {
            $nameLength = \strlen($option->getName()) + 2;
            if ($option->getShortcut()) {
                $nameLength += \strlen($option->getShortcut()) + 3;
            }

            $max = \max($max, $nameLength);
        }

        foreach ($this->getArguments() as $argument) {
            $max = \max($max, \strlen($argument->getName()));
        }

        return ++$max;
    }
1223120
public function columnCount()
    {
        $maxCol = 0;

        foreach ($this->_layout as $row => $items) {
            foreach ($items as $column => $item) {
                $maxCol = max($column, $maxCol);
            }
        }

        return $maxCol;
    }
1286371
def _get_width(maxwidth):
    """"""
    width = maxwidth / 3
    if maxwidth <= 60:
        width = maxwidth
    elif 60 < maxwidth <= 120:
        width = maxwidth / 2
    return width
827521
protected function getWidth()
    {
        $first_row = reset($this->data);
        $first_row = $this->buildRow($first_row);

        return $this->lengthWithoutTags($first_row);
    }
1232609
public function getPostMaxSize()
    {
        $iniMax = strtolower($this->getNormalizedIniPostMaxSize());

        if ('' === $iniMax) {
            return;
        }

        $max = ltrim($iniMax, '+');
        if (0 === strpos($max, '0x')) {
            $max = \intval($max, 16);
        } elseif (0 === strpos($max, '0')) {
            $max = \intval($max, 8);
        } else {
            $max = (int) $max;
        }

        switch (substr($iniMax, -1)) {
            case 't': $max *= 1024;
            // no break
            case 'g': $max *= 1024;
            // no break
            case 'm': $max *= 1024;
            // no break
            case 'k': $max *= 1024;
        }

        return $max;
    }
880783
public function getWidth(): int
    {
        $total = 0;
        foreach ($this as $token) {
            $total += $token->width();
        }

        return $total;
    }
882334
protected function getBarStrLen()
    {
        if (!$this->bar_str_len) {
            // Subtract 10 because of the '> 100%' plus some padding, max 100
            $this->bar_str_len = min($this->util->width() - 10, 100);
        }

        return $this->bar_str_len;
    }
717800
function get_min_max_width()
    {
        if (!is_null($this->_min_max_cache)) {
            return $this->_min_max_cache;
        }

        $style = $this->_frame->get_style();

        // Account for margins & padding
        $dims = array($style->padding_left,
            $style->padding_right,
            $style->border_left_width,
            $style->border_right_width,
            $style->margin_left,
            $style->margin_right);

        $cb_w = $this->_frame->get_containing_block("w");
        $delta = (float)$style->length_in_pt($dims, $cb_w);

        // Handle degenerate case
        if (!$this->_frame->get_first_child()) {
            return $this->_min_max_cache = array(
                $delta, $delta,
                "min" => $delta,
                "max" => $delta,
            );
        }

        $low = array();
        $high = array();

        for ($iter = $this->_frame->get_children()->getIterator(); $iter->valid(); $iter->next()) {
            $inline_min = 0;
            $inline_max = 0;

            // Add all adjacent inline widths together to calculate max width
            while ($iter->valid() && in_array($iter->current()->get_style()->display, Style::$INLINE_TYPES)) {
                $child = $iter->current();

                $minmax = $child->get_min_max_width();

                if (in_array($iter->current()->get_style()->white_space, array("pre", "nowrap"))) {
                    $inline_min += $minmax["min"];
                } else {
                    $low[] = $minmax["min"];
                }

                $inline_max += $minmax["max"];
                $iter->next();
            }

            if ($inline_max > 0) {
                $high[] = $inline_max;
            }
            if ($inline_min > 0) {
                $low[] = $inline_min;
            }

            if ($iter->valid()) {
                list($low[], $high[]) = $iter->current()->get_min_max_width();
                continue;
            }
        }
        $min = count($low) ? max($low) : 0;
        $max = count($high) ? max($high) : 0;

        // Use specified width if it is greater than the minimum defined by the
        // content.  If the width is a percentage ignore it for now.
        $width = $style->width;
        if ($width !== "auto" && !Helpers::is_percent($width)) {
            $width = (float)$style->length_in_pt($width, $cb_w);
            if ($min < $width) {
                $min = $width;
            }
            if ($max < $width) {
                $max = $width;
            }
        }

        $min += $delta;
        $max += $delta;
        return $this->_min_max_cache = array($min, $max, "min" => $min, "max" => $max);
    }
122382
public function getWidth()
    {
        if (null === $this->width && !$this->initialised) {
            $this->refreshDimensions();
        }

        if (null === $this->width) {
            $width = getenv('COLUMNS');
            if (false !== $width) {
                $this->width = (int) trim($width);
            }
        }

        return $this->width ?: static::DEFAULT_WIDTH;
    }
1075499
public function render()
    {
        $lines = explode("\n", $this->text);
        $maxWidth = 0;
        foreach ($lines as $line) {
            if (strlen($line) > $maxWidth) {
                $maxWidth = strlen($line);
            }
        }

        $maxWidth += $this->padding * 2 + 2;
        $output = str_repeat($this->periphery, $maxWidth) . "\n";//first line
        foreach ($lines as $line) {
            $space = $maxWidth - (strlen($line) + 2 + $this->padding * 2);
            $output .= $this->periphery . str_repeat(' ', $this->padding) . $line . str_repeat(' ', $space + $this->padding) . $this->periphery . "\n";
        }
        $output .= str_repeat($this->periphery, $maxWidth);
        return $output;
    }
477084
public function getDepth(): int
    {
        $layerDepth = 0;

        foreach ($this->items as $item) {
            $layerDepth = max($layerDepth, $item->getZ() + $item->getDepth());
        }

        return $layerDepth - $this->getStartDepth();
    }
531638
protected function getMaxContentWidth($columnCount)
    {
        $style = $this->getStyle();
        $verticalBorderQuantity = $columnCount + 1;
        $paddingQuantity = $columnCount * 2;

        return $this->maxTableWidth
            - $verticalBorderQuantity * strlen($style->getVerticalBorderChar())
            - $paddingQuantity * strlen($style->getPaddingChar());
    }
1047699
def _multiline_width(multiline_s, line_width_fn=len):
    """"""
    return max(map(line_width_fn, re.split("[\r\n]", multiline_s)))
902195
def maxBoundSize(self):
        """"""
        b = self.polydata(True).GetBounds()
        return max(abs(b[1] - b[0]), abs(b[3] - b[2]), abs(b[5] - b[4]))
1097664
public static function getWidth()
    {
        $width = getenv('COLUMNS');
        if ($width !== false) {
            return (int) trim($width);
        }

        static::updateDimensions();

        return static::$width;
    }
157166
public function getLineHeight()
    {
        $lineHeight = $this->getFontSize() * 1.2 * $this->getLineSpacing();
        $this->convertFromPoints($lineHeight);
        return $lineHeight;
    }
1143521
public function GetStringWidthLines($string, $lines)
    {
        $words = preg_split("/(\s+)/", $string, null, PREG_SPLIT_DELIM_CAPTURE);

        if (count($words) <= 2 || $lines <= 1) {
            return $this->GetStringWidth($string);
        }

        $min = 0;

        $widths = array();

        foreach ($words as $i => $w) {
            if ($w == "") {
                $widths[$i] = 0;
            } else {
                $widths[$i] = $this->GetStringWidth($w);
            }
        }

        $maxwidth = 0;

        for ($j = 1; $j < count($widths) && $lines > 0; $lines--) {
            if ($j > 0) {
                $wset = array_slice($widths, $j);
            } else {
                $wset = $widths;
            }
            $target = (array_sum($wset)) / $lines;

            $l = $widths[$j - 1];

            for (; $l < $target && $j < count($widths); $j += 2) {
                $l += $widths[$j] + $widths[$j + 1];
            }

            if ($j < count($widths)) {
                $cw = $widths[$j + 1];

                if ($l - $target < $target + $cw - $l) {
                    $j += 2;
                } else {
                    $l -= $cw + $widths[$j];
                }
            }

            if ($maxwidth < $l) {
                $maxwidth = $l;
            }
        }

        return $maxwidth;
    }