Perform a full snapshot of the current state.

        Snapshots are a combination of the :attr:`~state_root` at the time of the
        snapshot and the id of the changeset from the journaled DB.
341924
def snapshot(self) -> Tuple[Hash32, UUID]:
        
        return self.state_root, self._account_db.record()
685359
def log_state(self, state):
        
        results = []
        for field_idx, field in enumerate(self.fields):
            parent, stat = None, state
            for f in field:
                parent, stat = stat, stat[f]
            results.append(stat)
        self.log(*results)
220992
def get_or_instantiate_db_state(working_dir):
    

    # instantiates
    new_db = BlockstackDB.borrow_readwrite_instance(working_dir, -1)
    BlockstackDB.release_readwrite_instance(new_db, -1)

    return get_db_state(working_dir)
1252645
function() {
			// Stack for all the undo and redo snapshots, they're always created/removed
			// in consistency.
			this.snapshots = [];

			// Current snapshot history index.
			this.index = -1;

			this.currentImage = null;

			this.hasUndo = false;
			this.hasRedo = false;
			this.locked = null;

			this.resetType();
		}
1066764
def collect_snapshot(self):
        
        try:
            if "INSTANA_SERVICE_NAME" in os.environ:
                appname = os.environ["INSTANA_SERVICE_NAME"]
            elif "FLASK_APP" in os.environ:
                appname = os.environ["FLASK_APP"]
            elif "DJANGO_SETTINGS_MODULE" in os.environ:
                appname = os.environ["DJANGO_SETTINGS_MODULE"].split('.')[0]
            elif os.path.basename(sys.argv[0]) == '' and sys.stdout.isatty():
                appname = "Interactive Console"
            else:
                if os.path.basename(sys.argv[0]) == '':
                    appname = os.path.basename(sys.executable)
                else:
                    appname = os.path.basename(sys.argv[0])

            s = Snapshot(name=appname, version=platform.version(),
                         f=platform.python_implementation(),
                         a=platform.architecture()[0],
                         djmw=self.djmw)
            s.version = sys.version
            s.versions = self.collect_modules()
        except Exception as e:
            logger.debug(e.message)
        else:
            return s
1300593
public boolean isEmpty() {
		int snapshotSize = cleared ? 0 : snapshot.size();
		//nothing in both
		if ( snapshotSize == 0 && currentState.isEmpty() ) {
			return true;
		}
		//snapshot bigger than changeset
		if ( snapshotSize > currentState.size() ) {
			return false;
		}
		return size() == 0;
	}
1348009
def snapshot(self, mode):
        '''
        
        '''
        self._init_env()

        self._save_cfg_packages(self._get_changed_cfg_pkgs(self._get_cfg_pkgs()))
        self._save_payload(*self._scan_payload())
319552
@Override
	public void snapshotState(FunctionSnapshotContext context) throws Exception {
		sessionIdsPerSnapshot.add(new Tuple2<>(context.getCheckpointId(), sessionIds));
		sessionIds = new ArrayList<>(64);
		super.snapshotState(context);
	}
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)
645181
public HashMap<StreamShardMetadata, SequenceNumber> snapshotState() {
		// this method assumes that the checkpoint lock is held
		assert Thread.holdsLock(checkpointLock);

		HashMap<StreamShardMetadata, SequenceNumber> stateSnapshot = new HashMap<>();
		for (KinesisStreamShardState shardWithState : subscribedShardsState) {
			stateSnapshot.put(shardWithState.getStreamShardMetadata(), shardWithState.getLastProcessedSequenceNum());
		}
		return stateSnapshot;
	}
629188
def list_snapshots(config='root'):
    '''
    
    '''
    try:
        snapshots = snapper.ListSnapshots(config)
        return [_snapshot_to_data(s) for s in snapshots]
    except dbus.DBusException as exc:
        raise CommandExecutionError(
            'Error encountered while listing snapshots: {0}'
            .format(_dbus_exception_to_reason(exc, locals()))
        )
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()))
956010
def start_from_snapshot(self, name):
        
        _, r = self.datacenter.request('POST', self.path + '/snapshots/' + 
            str(name))
        r.raise_for_status()
        return self
744496
public void snapshotState(StateSnapshotContext context) throws Exception {
		final KeyedStateBackend<?> keyedStateBackend = getKeyedStateBackend();
		//TODO all of this can be removed once heap-based timers are integrated with RocksDB incremental snapshots
		if (keyedStateBackend instanceof AbstractKeyedStateBackend &&
			((AbstractKeyedStateBackend<?>) keyedStateBackend).requiresLegacySynchronousTimerSnapshots()) {

			KeyedStateCheckpointOutputStream out;

			try {
				out = context.getRawKeyedOperatorStateOutput();
			} catch (Exception exception) {
				throw new Exception("Could not open raw keyed operator state stream for " +
					getOperatorName() + '.', exception);
			}

			try {
				KeyGroupsList allKeyGroups = out.getKeyGroupList();
				for (int keyGroupIdx : allKeyGroups) {
					out.startNewKeyGroup(keyGroupIdx);

					timeServiceManager.snapshotStateForKeyGroup(
						new DataOutputViewStreamWrapper(out), keyGroupIdx);
				}
			} catch (Exception exception) {
				throw new Exception("Could not write timer service of " + getOperatorName() +
					" to checkpoint state stream.", exception);
			} finally {
				try {
					out.close();
				} catch (Exception closeException) {
					LOG.warn("Could not close raw keyed operator state stream for {}. This " +
						"might have prevented deleting some state data.", getOperatorName(), closeException);
				}
			}
		}
	}
643636
def snapshot_original_rds
      unless @new_instance || @snapshot
        update_status "Waiting for RDS instance #{@original_server.id}"
        @original_server.wait_for { ready? }
        update_status "Creating snapshot #{@snapshot_id} from RDS #{rds_id}"
        @snapshot = @rds.snapshots.create(id: @snapshot_id, instance_id: rds_id)
      end
    end
755055
def _get_head_state(self):
        
        if not self.head_state:
            root = self._get_head_block().state_root
            self.head_state = State(self.db, root)
        return self.head_state
98192
def make_snapshot(self):
        
        filename = join(self.output_dir, '{:010d}.pkl'.format(self.model.i))
        output_utils.model_to_file(self.model, filename)