Calculate the widths or heights for the items, the wrapper, and the cycle.
516078
function() {
        if (this.options.animation === 'fade') {
            return;
        }

        var dimension = this._dimension, // height or width
            containerSize = 0,
            sizes = [];

        this.container.removeAttr('style');

        this.items.each(function() {
            var item = $(this).removeAttr('style'),
                size = item[dimension](),
                marginStart = parseInt(item.css('margin-' + (dimension === 'width' ? 'left' : 'top')), 10),
                marginEnd = parseInt(item.css('margin-' + (dimension === 'width' ? 'right' : 'bottom')), 10),
                totalSize = size + marginStart + marginEnd;

            containerSize += totalSize;

            sizes.push({
                size: size,
                totalSize: totalSize,
                marginStart: marginStart,
                marginEnd: marginEnd,
                clone: item.hasClass('is-cloned')
            });

            // Set the size of the item explicitly
            item.css(dimension, size);
        });

        // Store the sizes
        this._sizes = sizes;

        // Set the container width/height
        this.container.css(dimension, containerSize);
    }
106297
def _compute_cols_width(self):
        

        if hasattr(self, "_width"):
            return
        maxi = []
        if self._header:
            maxi = [ self._len_cell(x) for x in self._header ]
        for row in self._rows:
            for cell,i in zip(row, list(range(len(row)))):
                try:
                    maxi[i] = max(maxi[i], self._len_cell(cell))
                except (TypeError, IndexError):
                    maxi.append(self._len_cell(cell))

        ncols = len(maxi)
        content_width = sum(maxi)
        deco_width = 3*(ncols-1) + [0,4][self._has_border()]
        if self._max_width and (content_width + deco_width) > self._max_width:
            """ content too wide to fit the expected max_width
            let's recompute maximum cell width for each cell
            """
            if self._max_width < (ncols + deco_width):
                raise ValueError('max_width too low to render data')
            available_width = self._max_width - deco_width
            newmaxi = [0] * ncols
            i = 0
            while available_width > 0:
                if newmaxi[i] < maxi[i]:
                    newmaxi[i] += 1
                    available_width -= 1
                i = (i + 1) % ncols
            maxi = newmaxi
        self._width = maxi
332319
private ArrayList<Rect> calculateAllBounds(Paint paint) {
        ArrayList<Rect> list = new ArrayList<Rect>();
        //For each views (If no values then add a fake one)
        final int count = mRecyclerView.getAdapter().getItemCount();
        final int width = getWidth();
        final int halfWidth = width / 2;
        for (int i = 0; i < count; i++) {
            Rect bounds = calcBounds(i, paint);
            int w = bounds.right - bounds.left;
            int h = bounds.bottom - bounds.top;
            bounds.left = (int)(halfWidth - (w / 2f) + ((i - mCurrentPage - mPageOffset) * width));
            bounds.right = bounds.left + w;
            bounds.top = 0;
            bounds.bottom = h;
            list.add(bounds);
        }

        return list;
    }
1212428
def compute_edge_widths(self):
        """"""
        if type(self.edge_width) is str:
            edges = self.graph.edges
            self.edge_widths = [edges[n][self.edge_width] for n in self.edges]
        else:
            self.edge_widths = self.edge_width
828992
def _calculate_optimal_column_widths(self):
        
        columns = len(self.data[0])  # number of columns
        str_labels = [parse_colorama(str(l)) for l in
                      self.labels]  # labels as strings
        str_data = [[parse_colorama(str(col)) for col in row] for row in
                    self.data]
        # values as strings

        widths = [0] * columns  # length of longest string in each column
        for row in str_data:  # calculate max width in each column
            widths = [max(w, len(c)) for w, c in zip(widths, row)]

        # check if label name is longer than data
        for col, label in enumerate(str_labels):
            if len(label) > widths[col]:
                widths[col] = len(label)

        self.widths = widths
1299189
function(container) {
		var top = container.el.offsetTop;
		var bottom = top+container.el.offsetHeight;
	
		var left = container.el.offsetLeft;
		var right = left+container.el.offsetWidth;
	
		return [
	    	{x : left, y: top},
	    	{x : left, y: bottom},
	    	{x : right, y: top},
	    	{x : right, y: bottom}
		];
   }
818487
def _compile_dimension_size(self, base_index, array,
                                property, sized_elements):
        """"""
        sort_index = base_index + 2
        sized_elements.sort(key=lambda x: x[sort_index])
        for element_data in sized_elements:
            start, end = element_data[base_index], element_data[sort_index]
            end += start
            element, size = element_data[4:6]

            # Find the total current size of the set
            set_size = sum(array[start:end]) + (end-start-1)*self.margin

            # Work out the extra space we need
            extra_space_needed = getattr(size, property) - set_size
            if extra_space_needed < 0: continue

            # Distribute it among the entries
            extra_space_each = extra_space_needed / (end-start)
            for index in range(start, end):
                array[index] += extra_space_each
380893
function() {
        var gutter = this.options.gutter,
            items = this.matrix,
            item,
            span,
            dir = this.options.rtl ? 'right' : 'left',
            y = [], // The top position values indexed by column
            c = 0, // Current column in the loop
            h = 0, // Smallest height column
            i, // Items loop counter
            l, // Items length
            s, // Current span column in the loop
            top,
            pos = { margin: 0, position: 'absolute' };

        for (i = 0; i < this.colCount; i++) {
            y.push(0);
        }

        for (i = 0, l = items.length; i < l; i++) {
            item = items[i];
            span = item.span;

            // Place the item in the smallest column
            h = -1;

            for (s = 0; s < this.colCount; s++) {
                if (h === -1 || y[s] < h) {
                    h = y[s];
                    c = s;
                }
            }

            // If the item extends too far out, move it to the next column
            // Or if the last column has been reached
            if ((c >= this.colCount) || ((span + c) > this.colCount)) {
                c = 0;
            }

            // Item spans a column or multiple columns
            if (span) {
                top = 0;

                // If the item spans multiple columns
                // Get the largest height from the previous row
                for (s = 0; s < span; s++) {
                    if (y[c + s] > top) {
                        top = y[c + s];
                    }
                }

                // Position the item
                pos.top = top;
                pos[dir] = (this.colWidth + gutter) * c;
                pos.width = ((this.colWidth + gutter) * span) - gutter;

                item.item.css(pos).reveal();

                // Loop again to add the value to each columns Y top value
                // This must be done after positioning so we can calculate a new size
                for (s = 0; s < span; s++) {
                    y[c + s] = item.item.outerHeight() + gutter + top;
                }
            }

            this.colHeights[c] = y[c];

            c++;
        }

        // Set height of wrapper
        this.element.css('height', Math.max.apply(Math, y));
    }
177476
def calculate_dimensions(image, long_side, short_side):
    """"""
    if image.width >= image.height:
        return '{0}x{1}'.format(long_side, short_side)
    return '{0}x{1}'.format(short_side, long_side)
1081573
def get_size(self):
        """"""
        self.curses.setupterm()
        return self.curses.tigetnum('cols'), self.curses.tigetnum('lines')
19537
function getSizes(requestSizes) {
  let width = 0;
  let height = 0;
  if (utils.isArray(requestSizes) && requestSizes.length === 2 &&
    !utils.isArray(requestSizes[0])) {
    width = parseInt(requestSizes[0], 10);
    height = parseInt(requestSizes[1], 10);
  } else if (typeof requestSizes === 'object') {
    for (let i = 0; i < requestSizes.length; i++) {
      let size = requestSizes[i];
      width = parseInt(size[0], 10);
      height = parseInt(size[1], 10);
      break;
    }
  }
  return [width, height];
}
1355737
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 = np.array(
                [obj.width().get() for obj in self._partitions_cache[0]]
                if len(self._partitions_cache) > 0
                else []
            )
        return self._widths_cache
1110883
def _sizes(self, objs, sized=None):
        '''
        '''
        self.exclude_refs(*objs)  # skip refs to objs
        s, t = {}, []
        for o in objs:
            i = id(o)
            if i in s:  # duplicate
                self._seen[i] += 1
                self._duplicate += 1
            else:
                s[i] = self._sizer(o, 0, sized)
            t.append(s[i])
        if sized:
            s = _sum([i.size for i in _values(s)])  # [] for Python 2.2
        else:
            s = _sum(_values(s))
        self._total += s  # accumulate
        return s, tuple(t)
577980
def get_dimensions(self):
        """"""
        return FrozenOrderedDict((k, len(v)) for k, v in self.ds.dimensions.items())
40226
def units(cls, scale=1):
        '''
        

        '''
        return [cls(x=scale), cls(y=scale), cls(z=scale)]
1257510
function() {
        var item,
            span,
            size,
            l = this.items.length;

        this.matrix = [];

        for (var i = 0; i < l; i++) {
            item = this.items.eq(i);
            size = item.data('matrix-column-width');

            // How many columns does this item span?
            span = Math.max(Math.round(size / this.colWidth), 1);

            // Span cannot be larger than the total number of columns
            if (span > this.colCount) {
                span = this.colCount;
            }

            this.matrix.push({
                item: item,
                span: span
            });

            // Multiple columns
            if (span > 1) {
                for (var s = 1; s < span; s++) {
                    if (this.matrix) {
                        this.matrix.push({
                            item: item,
                            span: false // Indicates an empty space
                        });
                    }
                }
            }
        }
    }
435677
private function calculateDimensions()
	{
		# calculate capatcha text box dimensions
		# which are the minimum image resource dimensions
	
		$this->_calculated_text_box['dimensions'] = $this->getTextBoxDimensions(
														$this->_background_text['size'],
														0,
														$this->_background_text['font'],
														$this->_code
														);

		# calculate how much each character takes from width
		$this->_calculated_text_box['char_width'] = $this->_calculated_text_box['dimensions']['width'] / $this->_code_length;

		# calculate additional width to add to the minimum text box width later
		$this->_calculated_text_box['additional_width'] = $this->_calculated_text_box['char_width'] * $this->_code_length + $this->_blocks_seperation;

		$this->_calculated_text_box['additional_height'] = rand( 5, 15 );	
		
		# set Initial Image Information width, height
		
		$this->_image_info['width']  = $this->_calculated_text_box['dimensions']['width']  + $this->_calculated_text_box['additional_width'];
			
		$this->_image_info['height'] = $this->_calculated_text_box['dimensions']['height'] + $this->_calculated_text_box['additional_height'];
		
		
		# Method End
	}