Iterates over all subplots and collects the extents of each.
167338
def _get_subplot_extents(self, overlay, ranges, range_type):
        
        if range_type == 'combined':
            extents = {'extents': [], 'soft': [], 'hard': [], 'data': []}
        else:
            extents = {range_type: []}
        items = overlay.items()
        if self.batched and self.subplots:
            subplot = list(self.subplots.values())[0]
            subplots = [(k, subplot) for k in overlay.data.keys()]
        else:
            subplots = self.subplots.items()

        for key, subplot in subplots:
            found = False
            if subplot is None:
                continue
            layer = overlay.data.get(key, None)
            if isinstance(self.hmap, DynamicMap) and layer is None:
                for _, layer in items:
                    if isinstance(layer, subplot.hmap.type):
                        found = True
                        break
                if not found:
                    layer = None
            if layer is None or not subplot.apply_ranges:
                continue

            if isinstance(layer, CompositeOverlay):
                sp_ranges = ranges
            else:
                sp_ranges = util.match_spec(layer, ranges) if ranges else {}
            for rt in extents:
                extent = subplot.get_extents(layer, sp_ranges, range_type=rt)
                extents[rt].append(extent)
        return extents
1315847
def _collect_fields(field_parts_list, include_parents):
    """"""
    fields = []
    subpart_lists = defaultdict(list)

    for parts in field_parts_list:
        field, subparts = parts[0], parts[1:]
        if subparts:
            if include_parents and field not in fields:
                fields.append(field)
            subpart_lists[field].append(subparts)
        else:
            fields.append(field)

    subfields = dict((field, _collect_fields(subparts, include_parents))
                     for field, subparts in six.iteritems(subpart_lists))

    return ParsedFieldList(fields, subfields)
939414
def extents(self):
        
        extents = self.bounds.ptp(axis=0)
        extents.flags.writeable = False
        return extents
458816
def __get_plots_of_the_current_page(self, section, page):
        """"""
        
        plots = []
        structure = [len(x) for x in self.sections[section].pages[page].layout]
        for key in self.sections[section].pages[page].elements.keys():
            if self.sections[section].pages[page].elements[key].plot_object is None:
                plots.append(None)
            else:
                plots.append(self.sections[section].pages[page].elements[key].name)


        plots_sub = []
        for idx, i in enumerate(list(accumulate(structure))):
            if idx == 0:
                plots_sub.append(plots[0:i])
            else :
                plots_sub.append(plots[list(accumulate(structure))[idx - 1]:i])

        return plots_sub
1018487
def _iter_coords(nsls):
    """"""
    # First convert all slices to ranges
    ranges = list()
    for nsl in nsls:
        if isinstance(nsl, int):
            ranges.append(range(nsl, nsl+1))
        else:
            ranges.append(range(nsl.start, nsl.stop))
    # Iterate through all matching coordinates
    yield from itertools.product(*ranges)
51020
def expand_all(self):
        
        if implementsCollapseAPI(self._tree):
            self._tree.expand_all()
            self._walker.clear_cache()
            self.refresh()
986832
def All(a, axis, keep_dims):
    
    return np.all(a, axis=axis if not isinstance(axis, np.ndarray) else tuple(axis),
                  keepdims=keep_dims),
296596
def create_figure(n_subplots, figsize):
    ""
    fig = plt.figure(figsize=figsize)
    axes = []

    for i in range(n_subplots):
        axes.append(fig.add_subplot(n_subplots, 1, i+1))

    return fig, axes
785862
def expand_all(self):
        """"""

        def aux(item):
            self.item(item, open=True)
            children = self.get_children(item)
            for c in children:
                aux(c)

        children = self.get_children("")
        for c in children:
            aux(c)
141946
def _plot(self):
        """"""
        squares = self._squares()
        sq_dimensions = self.add_squares(squares)

        for index, serie in enumerate(self.series):
            current_square = self._current_square(squares, index)
            self.gaugify(serie, squares, sq_dimensions, current_square)
941699
def nodes(self) -> iter:
        """"""
        yield from (elem for elem, subs in self.inclusions.items() if subs == ())
718559
def get_all(self, qry, tpl):
        '''  '''
        self.cur.execute(qry, tpl)
        result = self.cur.fetchall()
        return result
1285875
def plot_multi(func:Callable[[int,int,plt.Axes],None], r:int=1, c:int=1, figsize:Tuple=(12,6)):
    ""
    axes = plt.subplots(r, c, figsize=figsize)[1]
    for i in range(r):
        for j in range(c): func(i,j,axes[i,j])
602777
@Override
    void collectRangeVariables(RangeVariable[] rangeVariables, Set set) {

        for (int i = 0; i < nodes.length; i++) {
            if (nodes[i] != null) {
                nodes[i].collectRangeVariables(rangeVariables, set);
            }
        }

        if (rangeVariable != null) {
            for (int i = 0; i < rangeVariables.length; i++) {
                if (rangeVariables[i] == rangeVariable) {
                    set.add(rangeVariables[i]);
                }
            }
        }
    }
1239362
def get_extents(self, element, ranges, range_type='combined'):
        
        if self.batched:
            overlay = self.current_frame
            element = Bars(overlay.table(), kdims=element.kdims+overlay.kdims,
                           vdims=element.vdims)
            for kd in overlay.kdims:
                ranges[kd.name]['combined'] = overlay.range(kd)

        extents = super(BarPlot, self).get_extents(element, ranges, range_type)
        xdim = element.kdims[0]
        ydim = element.vdims[0]

        # Compute stack heights
        if self.stacked or self.stack_index:
            ds = Dataset(element)
            pos_range = ds.select(**{ydim.name: (0, None)}).aggregate(xdim, function=np.sum).range(ydim)
            neg_range = ds.select(**{ydim.name: (None, 0)}).aggregate(xdim, function=np.sum).range(ydim)
            y0, y1 = max_range([pos_range, neg_range])
        else:
            y0, y1 = ranges[ydim.name]['combined']

        padding = 0 if self.overlaid else self.padding
        _, ypad, _ = get_axis_padding(padding)
        y0, y1 = range_pad(y0, y1, ypad, self.logy)

        # Set y-baseline
        if y0 < 0:
            y1 = max([y1, 0])
        elif self.logy:
            y0 = (ydim.range[0] or (10**(np.log10(y1)-2)) if y1 else 0.01)
        else:
            y0 = 0

        # Ensure x-axis is picked up as categorical
        x0 = xdim.pprint_value(extents[0])
        x1 = xdim.pprint_value(extents[2])
        return (x0, y0, x1, y1)
602206
public void refineAll() {
		List<DetectPolygonFromContour.Info> detections = detector.getFound().toList();

		for (int i = 0; i < detections.size(); i++) {
			refine(detections.get(i));
		}
	}
539795
function () {
            var self = this;
            self.set('expanded', true);
            util.each(self.get('children'), function (c) {
                c.expandAll();
            });
        }