Snapshot current state.
321751
def snapshot(self):
        """"""
        self._snapshot = {
            'muted': self.muted,
            'volume': self.volume,
            'stream': self.stream
        }
        _LOGGER.info('took snapshot of current state of %s', self.friendly_name)
1133750
@Override
	public void snapshotState(FunctionSnapshotContext context) throws Exception {
		Preconditions.checkState(this.checkpointedState != null,
			"The " + getClass().getSimpleName() + " state has not been properly initialized.");

		this.checkpointedState.clear();
		this.checkpointedState.add(this.globalModificationTime);

		if (LOG.isDebugEnabled()) {
			LOG.debug("{} checkpointed {}.", getClass().getSimpleName(), globalModificationTime);
		}
	}
39575
def _get_last_snapshot(config='root'):
    '''
    
    '''
    snapshot_list = sorted(list_snapshots(config), key=lambda x: x['id'])
    return snapshot_list[-1]
157795
protected void completeSnapshot(Snapshot snapshot) {
    Assert.notNull(snapshot, "snapshot");
    snapshots.put(snapshot.index(), snapshot);

    if (currentSnapshot == null || snapshot.index() > currentSnapshot.index()) {
      currentSnapshot = snapshot;
    }

    // Delete old snapshots if necessary.
    if (!storage.retainStaleSnapshots()) {
      Iterator<Map.Entry<Long, Snapshot>> iterator = snapshots.entrySet().iterator();
      while (iterator.hasNext()) {
        Snapshot oldSnapshot = iterator.next().getValue();
        if (oldSnapshot.index() < currentSnapshot.index()) {
          iterator.remove();
          oldSnapshot.close();
          oldSnapshot.delete();
        }
      }
    }
  }
313736
def snapshots(self):
        
        j, _ = self.datacenter.request('GET', self.path + '/snapshots')
        return [Snapshot(machine=self, data=s) for s in j]
472968
def PushState(self, **_):
    """"""
    if self.verbose:
      logging.debug("Storing state %r", self.state)
    self.state_stack.append(self.state)
1114102
def snapshot             (self):
		""""""
		nextSnapshotNum  = self.nextSnapshotNum
		nextSnapshotPath = self.getFullPathToSnapshot(nextSnapshotNum)
		
		if os.path.lexists(nextSnapshotPath):
			self.rmR(nextSnapshotPath)
		self.mkdirp(os.path.join(nextSnapshotPath, ".experiment"))
		return self.dump(nextSnapshotPath).__markLatest(nextSnapshotNum)
847972
public function takeSnapshot()
    {
        $this->enabledTypeBefore = null;

        if ($this->typeDescriptors->contains($this->typeName)) {
            foreach ($this->typeDescriptors->listByTypeName($this->typeName) as $typeDescriptor) {
                if ($typeDescriptor->isEnabled()) {
                    $this->enabledTypeBefore = $typeDescriptor;
                }
            }
        }

        $this->snapshotTaken = true;
    }
260036
def update_snapshot(self, snapshot, display_name=None,
            display_description=None):
        
        return snapshot.update(display_name=display_name,
                display_description=display_description)
290089
def refresh(self):
        """"""
        self.trace(list(self._fnames.keys()), _refresh=True)
124070
def snapshot(self):
        """"""
        display_item = self.__class__()
        display_item.display_type = self.display_type
        # metadata
        display_item._set_persistent_property_value("title", self._get_persistent_property_value("title"))
        display_item._set_persistent_property_value("caption", self._get_persistent_property_value("caption"))
        display_item._set_persistent_property_value("description", self._get_persistent_property_value("description"))
        display_item._set_persistent_property_value("session_id", self._get_persistent_property_value("session_id"))
        display_item._set_persistent_property_value("calibration_style_id", self._get_persistent_property_value("calibration_style_id"))
        display_item._set_persistent_property_value("display_properties", self._get_persistent_property_value("display_properties"))
        display_item.created = self.created
        for graphic in self.graphics:
            display_item.add_graphic(copy.deepcopy(graphic))
        for display_data_channel in self.display_data_channels:
            display_item.append_display_data_channel(copy.deepcopy(display_data_channel))
        # this goes after the display data channels so that the layers don't get adjusted
        display_item._set_persistent_property_value("display_layers", self._get_persistent_property_value("display_layers"))
        return display_item
517609
def state(self):
    """"""
    ev = self._query_waiters.request(self.__do_query_state)
    ev.wait(1.0)
    return self._state
418712
public void snapshot() {
    snapshotPoolGroups =
        new ArrayList<PoolGroupSchedulable>(nameToPoolGroup.values());
    for (PoolGroupSchedulable poolGroup : snapshotPoolGroups) {
      poolGroup.snapshot();
    }
    scheduleQueue = null;
    preemptQueue = null;

    // Load the configured pools for stats and cm.jsp
    // (needs to modify nameToPoolGroup)
    Collection<PoolInfo> configuredPoolInfos =
        configManager.getConfiguredPoolInfos();
    if (configuredPoolInfos != null) {
      for (PoolInfo poolInfo : configuredPoolInfos) {
        getPoolSchedulable(poolInfo);
      }
    }
  }
78054
public Snapshot getCurrentSnapshot() {
    Map.Entry<Long, Snapshot> entry = snapshots.lastEntry();
    return entry != null ? entry.getValue() : null;
  }
918972
def snapshot
      { state: @state.root_hash,
        gas: gas_used,
        txs: @transactions,
        txcount: @transaction_count,
        refunds: refunds,
        suicides: suicides,
        suicides_size: suicides.size,
        logs: logs,
        logs_size: logs.size,
        journal: @journal, # pointer to reference, so is not static
        journal_size: @journal.size,
        ether_delta: ether_delta
      }
    end
468330
def update_state(self):
        """"""
        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.settimeout(self._timeout)
        try:
            if sock.connect_ex((self._ip, self._port['state'])) == 0:
                self.state = True
            else:
                self.state = False
            sock.close()
        except socket.error:
            raise
1201767
private void open() {
    for (Snapshot snapshot : loadSnapshots()) {
      snapshots.put(snapshot.index(), snapshot);
    }

    if (!snapshots.isEmpty()) {
      currentSnapshot = snapshots.lastEntry().getValue();
    }
  }