Recurses supplied DynamicMap to find all streams

    Args:
        dmap: DynamicMap to recurse to look for streams

    Returns:
        List of streams that were found
186814
def get_nested_streams(dmap):
    
    return list({s for dmap in get_nested_dmaps(dmap) for s in dmap.streams})
658832
def _GetDataStreams(self):
    
    if self._data_streams is None:
      if self._directory is None:
        self._directory = self._GetDirectory()

      self._data_streams = []

      # It is assumed that directory and link file entries typically
      # do not have data streams.
      if not self._directory and not self.link:
        data_stream = DataStream()
        self._data_streams.append(data_stream)

    return self._data_streams
585099
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return cpOptionValuePersistence.findWithDynamicQuery(dynamicQuery);
	}
194018
def _make_dynamic(self, hmap, dynamic_fn, streams):
        
        if isinstance(hmap, ViewableElement):
            return DynamicMap(dynamic_fn, streams=streams)
        dim_values = zip(*hmap.data.keys())
        params = util.get_param_values(hmap)
        kdims = [d(values=list(util.unique_iterator(values))) for d, values in
                 zip(hmap.kdims, dim_values)]
        return DynamicMap(dynamic_fn, streams=streams, **dict(params, kdims=kdims))
1229064
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return cpDefinitionInventoryPersistence.findWithDynamicQuery(dynamicQuery);
	}
1029680
def attach_streams(plot, obj, precedence=1.1):
    
    def append_refresh(dmap):
        for stream in get_nested_streams(dmap):
            if plot.refresh not in stream._subscribers:
                stream.add_subscriber(plot.refresh, precedence)
    return obj.traverse(append_refresh, [DynamicMap])
1033735
private static DecoratorMap group_map_(Map<String, PathMatcher> paths) {
        if (paths.isEmpty()) return concat();

        return new DecoratorMap() {
            @Override
            public Stream<Consumer<MutableContext>> map(Stream<Consumer<MutableContext>> in, Context ctx) {
                final Map<String, TimeSeriesValueSet> pathMapping = paths.entrySet().stream()
                        .collect(Collectors.toMap(Map.Entry::getKey,
                                pmEntry -> {
                                    return ctx.getTSData()
                                    .getCurrentCollection()
                                    .get(p -> pmEntry.getValue().match(p.getPath()), x -> true);
                                }));

                for (final Map.Entry<String, TimeSeriesValueSet> pm
                             : pathMapping.entrySet()) {
                    final String identifier = pm.getKey();
                    final List<Consumer<MutableContext>> applications = pm.getValue().stream()
                            .map(group -> {
                                Consumer<MutableContext> application = (nestedCtx) -> nestedCtx.putGroupAliasByName(identifier, group::getGroup);
                                return application;
                            })
                            .collect(Collectors.toList());

                    in = in.flatMap(inApplication -> applications.stream().map(inApplication::andThen));
                }
                return in;
            }
        };
    }
848167
private static DecoratorMap concat(DecoratorMap... d_maps) {
        return (Stream<Consumer<MutableContext>> in, Context ctx) -> {
            for (DecoratorMap d_map : d_maps) {
                in = d_map.map(in, ctx);
            }
            return in;
        };
    }
1288512
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commercePaymentMethodGroupRelPersistence.findWithDynamicQuery(dynamicQuery);
	}
181525
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return cpFriendlyURLEntryPersistence.findWithDynamicQuery(dynamicQuery);
	}
1333206
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commerceAccountPersistence.findWithDynamicQuery(dynamicQuery);
	}
736121
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commerceSubscriptionEntryPersistence.findWithDynamicQuery(dynamicQuery);
	}
1146529
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commerceDiscountPersistence.findWithDynamicQuery(dynamicQuery);
	}
1359776
def drop_streams(streams, kdims, keys):
    
    stream_params = stream_parameters(streams)
    inds, dims = zip(*[(ind, kdim) for ind, kdim in enumerate(kdims)
                       if kdim not in stream_params])
    get = operator.itemgetter(*inds) # itemgetter used for performance
    keys = (get(k) for k in keys)
    return dims, ([wrap_tuple(k) for k in keys] if len(inds) == 1 else list(keys))
332314
def _filter_cache(self, dmap, kdims):
        
        filtered = []
        for key, value in dmap.data.items():
            if not any(kd.values and v not in kd.values for kd, v in zip(kdims, key)):
                filtered.append((key, value))
        return filtered
101818
def items(self, *args, **kwargs):
        
        return self.get_stream()(self.get_object(*args, **kwargs))
1371807
@Override
	public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
		return commerceNotificationQueueEntryPersistence.findWithDynamicQuery(dynamicQuery);
	}