Use bottom-left packing algorithm to find a lower height for the 
        container.

        Arguments:
            width
            height

        Returns:
            tuple (width, height, PackingAlgorithm):
193445
def _refine_candidate(self, width, height):
        
        packer = newPacker(PackingMode.Offline, PackingBin.BFF, 
                pack_algo=self._pack_algo, sort_algo=SORT_LSIDE,
                rotation=self._rotation)
        packer.add_bin(width, height)
       
        for r in self._rectangles:
            packer.add_rect(*r)

        packer.pack()

        # Check all rectangles where packed
        if len(packer[0]) != len(self._rectangles):
            return None

        # Find highest rectangle
        new_height = max(packer[0], key=lambda x: x.top).top
        return(width, new_height, packer)
1243322
def getLowerDetectionLimit(self):
        
        ldl = self.getField('LowerDetectionLimit').get(self)
        try:
            return float(ldl)
        except ValueError:
            return 0
619853
def _crop_box(self, size):
        
        (left, top) = self.offset
        right = left + min(size[0], self.width)
        bottom = top + min(size[1], self.height)

        return (left, top, right, bottom)
1173931
def preferred_height(self, cli, width, max_available_height):
        
        return self.content.preferred_height(cli, width, max_available_height)
302731
def sizes(self: Any) -> Mapping[Hashable, int]:
        
        return Frozen(OrderedDict(zip(self.dims, self.shape)))
468185
def check_sizes(size, width, height):
    

    if not size:
        return width, height

    if len(size) != 2:
        raise ProtocolError(
            "size argument should be a pair (width, height)")
    if width is not None and width != size[0]:
        raise ProtocolError(
            "size[0] (%r) and width (%r) should match when both are used."
            % (size[0], width))
    if height is not None and height != size[1]:
        raise ProtocolError(
            "size[1] (%r) and height (%r) should match when both are used."
            % (size[1], height))
    return size
146159
def get_height_for_line(self, lineno, width):
        
        try:
            return self._line_heights[lineno, width]
        except KeyError:
            text = token_list_to_text(self.get_line(lineno))
            result = self.get_height_for_text(text, width)

            # Cache and return
            self._line_heights[lineno, width] = result
            return result
1093086
def _dims2shape(*dims):
    """"""
    if not dims:
        raise ValueError("expected at least one dimension spec")
    shape = list()
    for dim in dims:
        if isinstance(dim, int):
            dim = (0, dim)
        if isinstance(dim, tuple) and len(dim) == 2:
            if dim[0] < 0:
                raise ValueError("expected low dimension to be >= 0")
            if dim[1] < 0:
                raise ValueError("expected high dimension to be >= 0")
            if dim[0] > dim[1]:
                raise ValueError("expected low <= high dimensions")
            start, stop = dim
        else:
            raise TypeError("expected dimension to be int or (int, int)")
        shape.append((start, stop))
    return tuple(shape)
822437
public static CmsRectangle fromLeftTopWidthHeight(double left, double top, double width, double height) {

        CmsRectangle result = new CmsRectangle();
        result.m_left = left;
        result.m_top = top;
        result.m_width = width;
        result.m_height = height;
        return result;
    }
810896
def get_min_size(self):
        """"""
        if self.visible == False:
            return 0, 0
        else:
            return ((self.min_width or 0) + self.horizontal_padding + self.margin_left + self.margin_right,
                    (self.min_height or 0) + self.vertical_padding + self.margin_top + self.margin_bottom)
629070
def resize(self, width=None):
        
        (iw, ih) = self.size
        if width is None:
            width = min(iw, utils.term.width)
        elif isinstance(width, basestring):
            percents = dict([(pct, '%s%%' % (pct)) for pct in range(101)])
            width = percents[width]
        height = int(float(ih) * (float(width) / float(iw)))
        height //= 2
        self.img = self.img.resize((width, height))
33392
def _bottom_left_position(self, resource):
        
        image = self._get_scaled_image(resource)

        left = 0
        upper = int(round(resource.size[1] - image.size[1]))

        return image, left, upper
668736
def block_widths(self):
        
        if self._widths_cache is None:
            # The first column will have the correct lengths. We have an
            # invariant that requires that all blocks be the same width in a
            # column of blocks.
            self._widths_cache = (
                [obj.width() for obj in self._partitions_cache[0]]
                if len(self._partitions_cache) > 0
                else []
            )
        return self._widths_cache
1094528
def rank_width(self):
        
        rank_width = defaultdict(int)
        node_rank = self.node_rank()
        for rank in node_rank.values():
            rank_width[rank] += 1
        return dict(rank_width)
372262
def minimumLabelHeight(self):
        
        metrics = QFontMetrics(self.labelFont())
        return max(self._minimumLabelHeight,
                   metrics.height() + self.verticalLabelPadding())
876242
def _get_resize_options(self, dimensions):
        
        if dimensions and isinstance(dimensions, (tuple, list)):
            if len(dimensions) < 3:
                dimensions = tuple(dimensions) + (False, )
            return dimensions
1009296
float bottom(Table table) {
        // constructing a PdfTable
        PdfTable tmp = new PdfTable(table, indentLeft(), indentRight(), indentTop() - currentHeight);
        return tmp.getBottom();
    }