Recursively descend through an Layout and NdMapping objects
        in order to add the supplied dimension values to all contained
        HoloMaps.
429117
def _add_dimensions(self, item, dims, constant_keys):
        
        if isinstance(item, Layout):
            item.fixed = False

        dim_vals = [(dim, val) for dim, val in dims[::-1]
                    if dim not in self.drop]
        if isinstance(item, self.merge_type):
            new_item = item.clone(cdims=constant_keys)
            for dim, val in dim_vals:
                dim = asdim(dim)
                if dim not in new_item.kdims:
                    new_item = new_item.add_dimension(dim, 0, val)
        elif isinstance(item, self._nest_order[self.merge_type]):
            if len(dim_vals):
                dimensions, key = zip(*dim_vals)
                new_item = self.merge_type({key: item}, kdims=list(dimensions),
                                           cdims=constant_keys)
            else:
                new_item = item
        else:
            new_item = item.clone(shared_data=False, cdims=constant_keys)
            for k, v in item.items():
                new_item[k] = self._add_dimensions(v, dims[::-1], constant_keys)
        if isinstance(new_item, Layout):
            new_item.fixed = True

        return new_item
597024
public void add(int dimension, float value) {
        if(this.map.containsKey(dimension))
            this.map.put(dimension, this.map.get(dimension) + value);
        else
            this.map.put(dimension, value);
    }
1255639
def update(self, other):
        
        if isinstance(other, NdMapping):
            dims = [d for d in other.kdims if d not in self.kdims]
            if len(dims) == other.ndims:
                raise KeyError("Cannot update with NdMapping that has"
                               " a different set of key dimensions.")
            elif dims:
                other = other.drop_dimension(dims)
            other = other.data
        for key, data in other.items():
            self._add_item(key, data, sort=False)
        if self.sort:
            self._resort()
500467
private void addSubDimension(final Facets _facets,
                                 final DimValue _dimValue,
                                 final String _dim,
                                 final String _path)
        throws IOException
    {
        final FacetResult result = _facets.getTopChildren(1000, _dim, _path);
        if (result != null) {
            LOG.debug("FacetResult {}.", result);
            for (final LabelAndValue labelValue : result.labelValues) {
                final DimValue dimValue = new DimValue().setLabel(labelValue.label)
                                .setValue(labelValue.value.intValue());
                dimValue.setPath(ArrayUtils.addAll(_dimValue.getPath(), result.path));
                _dimValue.getChildren().add(dimValue);
                addSubDimension(_facets, dimValue, _dim, _path + "/" + labelValue.label);
            }
        }
    }
872363
public void addDecomposes(IfcObjectDefinition parent, IfcObjectDefinition... children) throws IfcModelInterfaceException {
		IfcRelAggregates ifcRelAggregates = this.create(IfcRelAggregates.class);
		ifcRelAggregates.setRelatingObject(parent);
		for (IfcObjectDefinition child: children) {
			ifcRelAggregates.getRelatedObjects().add(child);
		}
	}
1021476
function handleLayout(obj, stats, depth) {
      var layoutName = obj.layout.basename;
      debug('applied layout (#%d) "%s", to view "%s"', depth, layoutName, view.path);

      view.currentLayout = obj.layout;
      view.define('layoutStack', stats.history);
      app.handleOnce('onLayout', view);
      delete view.currentLayout;
    }
830722
private void __addLayoutSection(String name, String section, boolean def) {
        Map<String, String> m = def ? layoutSections0 : layoutSections;
        if (m.containsKey(name)) return;
        m.put(name, section);
    }
907083
protected void addPrevExpandedCurrent() {
		Set<String> rows = getExpandedRows();
		if (!rows.isEmpty()) {
			WTreeComponentModel model = getOrCreateComponentModel();
			if (model.prevExpandedRows == null) {
				model.prevExpandedRows = new HashSet<>();
			}
			model.prevExpandedRows.addAll(rows);
		}
	}
238717
def _apply_compositor(self, holomap, ranges=None, keys=None, dimensions=None):
        
        # Compute framewise normalization
        defaultdim = holomap.ndims == 1 and holomap.kdims[0].name != 'Frame'

        if keys and ranges and dimensions and not defaultdim:
            dim_inds = [dimensions.index(d) for d in holomap.kdims]
            sliced_keys = [tuple(k[i] for i in dim_inds) for k in keys]
            frame_ranges = OrderedDict([(slckey, self.compute_ranges(holomap, key, ranges[key]))
                                        for key, slckey in zip(keys, sliced_keys) if slckey in holomap.data.keys()])
        else:
            mapwise_ranges = self.compute_ranges(holomap, None, None)
            frame_ranges = OrderedDict([(key, self.compute_ranges(holomap, key, mapwise_ranges))
                                        for key in holomap.data.keys()])
        ranges = frame_ranges.values()

        return Compositor.collapse(holomap, (ranges, frame_ranges.keys()), mode='display')
984925
function revalue(node, depth) {
    var children = node.children,
        v = 0;
    if (children && (n = children.length)) {
      var i = -1,
          n,
          j = depth + 1;
      while (++i < n) v += revalue(children[i], j);
    } else if (value) {
      v = +value.call(hierarchy, d3_layout_hierarchyInline ? node : node.data, depth) || 0;
    }
    if (value) node.value = v;
    return v;
  }
536324
void setDimens(int width, int height) {
        mAreDimensOverridden = true;
        mDesiredWidth = width;
        mDesiredHeight = height;
        requestLayout();
    }
273253
def _merge_dimensions(dimension, preferred=None, dont_extend=False):
        
        dimension = dimension or LayoutDimension()

        # When a preferred dimension was explicitly given to the Window,
        # ignore the UIControl.
        if dimension.preferred_specified:
            preferred = dimension.preferred

        # When a 'preferred' dimension is given by the UIControl, make sure
        # that it stays within the bounds of the Window.
        if preferred is not None:
            if dimension.max:
                preferred = min(preferred, dimension.max)

            if dimension.min:
                preferred = max(preferred, dimension.min)

        # When a `dont_extend` flag has been given, use the preferred dimension
        # also as the max dimension.
        if dont_extend and preferred is not None:
            max_ = min(dimension.max, preferred)
        else:
            max_ = dimension.max

        return LayoutDimension(
            min=dimension.min, max=max_,
            preferred=preferred, weight=dimension.weight)
91129
def expand_dimension(self, newdim, dimension, maps={}, relations={}):
        '''  '''
        
        for name, attr in self.__attributes__.items():
            if attr.dim == dimension:
                newattr = attr.copy()
                newattr.empty(newdim - attr.size)
                self.__attributes__[name] = concatenate_attributes([attr, newattr])

        for name, rel in self.__relations__.items():
            if dimension == rel.dim:
                # We need the new relation from the user
                if not rel.name in relations:
                    raise ValueError('You need to provide the relation {} for this resize'.format(rel.name))
                else:
                    if len(relations[name]) != newdim:
                        raise ValueError('New relation {} should be of size {}'.format(rel.name, newdim))
                    else:
                        self.__relations__[name].value = relations[name]
            
            elif dimension == rel.map:
                # Extend the index
                rel.index = range(newdim)
                
        for (a, b), rel in self.maps.items():
            if dimension == rel.dim:
                # We need the new relation from the user
                if not (a, b) in maps:
                    raise ValueError('You need to provide the map {}->{} for this resize'.format(a,  b))
                else:
                    if len(maps[a, b]) != newdim:
                        raise ValueError('New map {} should be of size {}'.format(rel.name, newdim))
                    else:
                        rel.value = maps[a, b]
            
            elif dimension == rel.map:
                # Extend the index
                rel.index = range(newdim)
        
        # Update dimensions
        self.dimensions[dimension] = newdim
        
        return self
89677
function (root, expandStack, applyFishEyeViewToEachNode) {
    if (root._private.data.collapsedChildren != null) {
      expandStack.push(root);
      this.expandNode(root, applyFishEyeViewToEachNode);
    }
    var children = root.children();
    for (var i = 0; i < children.length; i++) {
      var node = children[i];
      this.expandAllTopDown(node, expandStack, applyFishEyeViewToEachNode);
    }
  }
783425
def bulk_add_dimensions(dimension_list, **kwargs):
    
    added_dimensions = []
    for dimension in dimension_list:
        added_dimensions.append(add_dimension(dimension, **kwargs))

    return JSONObject({"dimensions": added_dimensions})
152867
public static INDArray add(INDArray x, INDArray y, INDArray z, int... dimensions) {
        if(dimensions == null || dimensions.length == 0) {
            validateShapesNoDimCase(x,y,z);
            return Nd4j.getExecutioner().exec(new OldAddOp(x,y,z));
        }

        return Nd4j.getExecutioner().exec(new BroadcastAddOp(x,y,z,dimensions));
    }
347489
function(dimensions, usedDimensions, usedValues) {
        var activeDimensions = new Array(dimensions.length);
        var valueCounter = 1;
        for(var i=0; i<dimensions.length; i++) {
            var dimensionName;
            for(dimensionName in dimensions[i]){break}
            if(usedDimensions[dimensionName] === undefined) {
                activeDimensions[i] = 0;
                continue;
            }
            activeDimensions[i] = 1;
            this.dimensionsList.push(dimensionName);
            var labelCollector = {};
            valueCounter = this._dimensionWalk(dimensions[i][dimensionName], usedValues[dimensionName],
                valueCounter, [0], this.precedenceMap, labelCollector, this.numberToValue);
            this.valueToNumber[dimensionName] = labelCollector;
        }
        return activeDimensions;
    }