Return a snapshot of all streams in existence at time of call.
320856
def get_streams(self):
        
        self._write_lock.acquire()
        try:
            return itervalues(self._stream_by_id)
        finally:
            self._write_lock.release()
906421
def snapshots(self):
        
        self.connection._check_login()
        response = self.connection._do_get("{}/{}".format(self.connection._api_url, "types/Volume/instances")).json()
        all_volumes_snapshot = []
        for volume in response:
            if volume['volumeType'] == 'Snapshot':
                all_volumes_snapshot.append(
                    Volume.from_dict(volume)
            )
        return all_volumes_snapshot
505023
def snapshot(self):
        """"""
        data_item = self.__class__()
        # data format (temporary until moved to buffered data source)
        data_item.large_format = self.large_format
        data_item.set_data_and_metadata(copy.deepcopy(self.data_and_metadata), self.data_modified)
        # metadata
        data_item.created = self.created
        data_item.timezone = self.timezone
        data_item.timezone_offset = self.timezone_offset
        data_item.metadata = self.metadata
        data_item.title = self.title
        data_item.caption = self.caption
        data_item.description = self.description
        data_item.session_id = self.session_id
        data_item.session_data = copy.deepcopy(self.session_data)
        return data_item
52364
def snapshot(self):
        
        return dict((category, dict((name, metric.value())
                                    for name, metric in list(metrics.items())))
                    for category, metrics in
                    list(self._store.items()))
1367809
def MultiReadClientSnapshot(self, client_ids):
    """"""
    res = {}
    for client_id in client_ids:
      history = self.clients.get(client_id, None)
      if not history:
        res[client_id] = None
        continue
      last_timestamp = max(history)
      last_serialized = history[last_timestamp]
      client_obj = rdf_objects.ClientSnapshot.FromSerializedString(
          last_serialized)
      client_obj.timestamp = last_timestamp
      client_obj.startup_info = rdf_client.StartupInfo.FromSerializedString(
          self.startup_history[client_id][last_timestamp])
      res[client_id] = client_obj
    return res
917217
def snapshot_map(snapshots, &block)
      applier = lambda do |snapshot|
        return if !snapshot || snapshot.empty?

        snapshot[:children].each do |child|
          applier.call(child)
        end

        block.call(snapshot)
      end

      applier.call(snapshots)
    end
1125037
def _get_event_stream(self):
        """"""
        self.__event_handle = threading.Event()
        event_thread = threading.Thread(target=self.thread_function)
        event_thread.start()
208597
public long[] snapshot() {
        this.increment(0);  //  refresh just in case it's been idle a long time
        final long[] range = new long[this.buckets.length];
        if (this.indexOfOldest != 0) {
            final int lengthOfFirstSection = this.buckets.length - this.indexOfOldest;
            System.arraycopy(this.buckets, this.indexOfOldest, range, 0, lengthOfFirstSection);
            System.arraycopy(this.buckets, 0, range, lengthOfFirstSection, this.buckets.length - lengthOfFirstSection); //  wrap around
        } else {
            System.arraycopy(this.buckets, this.indexOfOldest, range, 0, this.buckets.length);
        }
        Collections.reverse(Longs.asList(range));
        return range;
    }
1012759
@Override
    public Set<Stream> getResultStreams() {
    	Set<Stream> streams = ImmutableSet.of(this.resultStream);
		return streams;
    }
480248
private CompletableFuture<Void> handleSnapshot() {
    return Futures.allOf(partitions.values().stream()
        .map(partition -> partition.snapshot())
        .collect(Collectors.toList()))
        .thenApply(v -> null);
  }
313736
def snapshots(self):
        
        j, _ = self.datacenter.request('GET', self.path + '/snapshots')
        return [Snapshot(machine=self, data=s) for s in j]
684174
def _GetDataStreams(self):
    
    if self._data_streams is None:
      self._data_streams = []
      if self._fsntfs_file_entry.has_default_data_stream():
        data_stream = NTFSDataStream(None)
        self._data_streams.append(data_stream)

      for fsntfs_data_stream in self._fsntfs_file_entry.alternate_data_streams:
        data_stream = NTFSDataStream(fsntfs_data_stream)
        self._data_streams.append(data_stream)

    return self._data_streams
122323
public static Snapshot getSnapshot(ExecutorService service) {
        Preconditions.checkNotNull(service, "service");
        if (service instanceof ThreadPoolExecutor) {
            val tpe = (ThreadPoolExecutor) service;
            return new Snapshot(tpe.getQueue().size(), tpe.getActiveCount(), tpe.getPoolSize());
        } else if (service instanceof ForkJoinPool) {
            val fjp = (ForkJoinPool) service;
            return new Snapshot(fjp.getQueuedSubmissionCount(), fjp.getActiveThreadCount(), fjp.getPoolSize());
        } else {
            return null;
        }
    }
1185206
def _load_streams(self):
        
        common_err_msg = 'No valid {} stream configurations found. '
        specific_err_msg = {'inbound': 'No data will be received (or displayed).',
                            'outbound': 'No data will be published.'}
        err_msgs = {}

        for stream_type in ['inbound', 'outbound']:
            err_msgs[stream_type] = common_err_msg.format(stream_type) + specific_err_msg[stream_type]
            streams = ait.config.get('server.{}-streams'.format(stream_type))

            if streams is None:
                log.warn(err_msgs[stream_type])
            else:
                for index, s in enumerate(streams):
                    try:
                        if stream_type == 'inbound':
                            strm = self._create_inbound_stream(s['stream'])
                            if type(strm) == PortInputStream:
                                self.servers.append(strm)
                            else:
                                self.inbound_streams.append(strm)
                        elif stream_type == 'outbound':
                            strm = self._create_outbound_stream(s['stream'])
                            self.outbound_streams.append(strm)
                        log.info('Added {} stream {}'.format(stream_type, strm))
                    except Exception:
                        exc_type, value, tb = sys.exc_info()
                        log.error('{} creating {} stream {}: {}'.format(exc_type,
                                                                        stream_type,
                                                                        index,
                                                                        value))
        if not self.inbound_streams and not self.servers:
            log.warn(err_msgs['inbound'])

        if not self.outbound_streams:
            log.warn(err_msgs['outbound'])
875479
def load_all(stream):
    
    loader = YAMLDictLoader(stream)
    try:
        while loader.check_data():
            yield loader.get_data()
    finally:
        loader.dispose()
1062118
def find_stream(self, **kwargs):
        
        found = list(self.find_streams(**kwargs).values())
        if not found:
            raise StreamNotFoundError(kwargs)
        if len(found) > 1:
            raise MultipleStreamsFoundError(kwargs)
        return found[0]
85718
public Datastream[] getDatastreams(Context context,
                                       String pid,
                                       Date asOfDateTime,
                                       String dsState) throws ServerException {
        return delegate.getDatastreams(context, pid, asOfDateTime, dsState);
    }