Returns a deep copy of the snapshot, where the serializer is changed to the given serializer.
340978
public HeapPriorityQueueSnapshotRestoreWrapper<T> forUpdatedSerializer(
		@Nonnull TypeSerializer<T> updatedSerializer) {

		RegisteredPriorityQueueStateBackendMetaInfo<T> updatedMetaInfo =
			new RegisteredPriorityQueueStateBackendMetaInfo<>(metaInfo.getName(), updatedSerializer);

		return new HeapPriorityQueueSnapshotRestoreWrapper<>(
			priorityQueue,
			updatedMetaInfo,
			keyExtractorFunction,
			localKeyGroupRange,
			totalKeyGroups);
	}
783714
def create_snapshot(self, volume, name, description=None, force=False):
        
        return self.api.create_snapshot(volume, name, description=description,
                force=force)
1039598
def copy(self):
        
        from copy import deepcopy
        cp = type(self)()
        cp._metainfo = deepcopy(self._metainfo)
        return cp
1030253
def Copy(self):
    
    result = QueueManager(store=self.data_store, token=self.token)
    result.prev_frozen_timestamps = self.prev_frozen_timestamps
    result.frozen_timestamp = self.frozen_timestamp
    return result
612856
def copy(self,deep=yes):
        
        if deep:
            return copy.deepcopy(self)
        else:
            return copy.copy(self)
1202024
public function getSnapshot(): Snapshot
    {
        $value = $this->apiClient->get($this->uri);

        return new Snapshot($this, $value);
    }
618439
def save(self, *args, **kwargs):
        """"""
        update = getattr(self, 'instance', None) is not None
        instance = super(
            WithDynamicSerializerMixin,
            self
        ).save(
            *args,
            **kwargs
        )
        view = self._context.get('view')
        if view and update:
            if int(DRF_VERSION[0]) <= 3 and int(DRF_VERSION[1]) < 5:
                # Reload the object on update
                # to get around prefetch cache issues
                # Fixed in DRF in 3.5.0
                instance = self.instance = view.get_object()
        return instance
375978
public <T> T copy (T object) {
		if (object == null) return null;
		if (copyShallow) return object;
		copyDepth++;
		try {
			if (originalToCopy == null) originalToCopy = new IdentityMap();
			Object existingCopy = originalToCopy.get(object);
			if (existingCopy != null) return (T)existingCopy;

			if (copyReferences) needsCopyReference = object;
			Object copy;
			if (object instanceof KryoCopyable)
				copy = ((KryoCopyable)object).copy(this);
			else
				copy = getSerializer(object.getClass()).copy(this, object);
			if (needsCopyReference != null) reference(copy);
			if (TRACE || (DEBUG && copyDepth == 1)) log("Copy", copy, -1);
			return (T)copy;
		} finally {
			if (--copyDepth == 0) reset();
		}
	}
146524
public TypeSerializer<T> getReconfiguredSerializer() {
		Preconditions.checkState(
			isCompatibleWithReconfiguredSerializer(),
			"It is only possible to get a reconfigured serializer if the compatibility type is %s, but the type is %s",
			Type.COMPATIBLE_WITH_RECONFIGURED_SERIALIZER, resultType);
		return reconfiguredNewSerializer;
	}
196513
public static <K, N> InternalTimersSnapshotWriter getWriterForVersion(
			int version,
			InternalTimersSnapshot<K, N> timersSnapshot,
			TypeSerializer<K> keySerializer,
			TypeSerializer<N> namespaceSerializer) {

		switch (version) {
			case NO_VERSION:
				return new InternalTimersSnapshotWriterPreVersioned<>(timersSnapshot, keySerializer, namespaceSerializer);

			case 1:
				return new InternalTimersSnapshotWriterV1<>(timersSnapshot, keySerializer, namespaceSerializer);

			case InternalTimerServiceSerializationProxy.VERSION:
				return new InternalTimersSnapshotWriterV2<>(timersSnapshot, keySerializer, namespaceSerializer);

			default:
				// guard for future
				throw new IllegalStateException(
					"Unrecognized internal timers snapshot writer version: " + version);
		}
	}
1349893
def consistency(self, consistency):
        
        clone = copy.deepcopy(self)
        clone._consistency = consistency
        return clone
1071138
def to_representation(self, obj):
        
        many = isinstance(obj, collections.Iterable) \
            or isinstance(obj, models.Manager) \
            and not isinstance(obj, dict)

        assert self.serializer is not None \
            and issubclass(self.serializer, serializers.ModelSerializer), (
                "Bad serializer defined %s" % self.serializer
            )

        extra_params = {}
        if issubclass(self.serializer, ModelPermissionsSerializer):
            extra_params['cached_allowed_fields'] =\
                self.parent.cached_allowed_fields

        ser = self.serializer(obj, context=self.context, many=many,
                              **extra_params)
        return ser.data
40477
@Override
	public PojoSerializerSnapshot<T> snapshotConfiguration() {
		return buildSnapshot(
				clazz,
				registeredClasses,
				registeredSerializers,
				fields,
				fieldSerializers,
				subclassSerializerCache);
	}
597420
public static NestedSerializersSnapshotDelegate legacyReadNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
		@SuppressWarnings("deprecation")
		final List<Tuple2<TypeSerializer<?>, TypeSerializerSnapshot<?>>> serializersAndSnapshots =
				TypeSerializerSerializationUtil.readSerializersAndConfigsWithResilience(in, cl);

		final TypeSerializerSnapshot<?>[] nestedSnapshots = serializersAndSnapshots.stream()
				.map(t -> t.f1)
				.toArray(TypeSerializerSnapshot<?>[]::new);

		return new NestedSerializersSnapshotDelegate(nestedSnapshots);
	}
294398
def clone(self, transformed=True):
        
        poly = self.polydata(transformed=transformed)
        polyCopy = vtk.vtkPolyData()
        polyCopy.DeepCopy(poly)

        cloned = Actor()
        cloned.poly = polyCopy
        cloned.mapper.SetInputData(polyCopy)
        cloned.mapper.SetScalarVisibility(self.mapper.GetScalarVisibility())
        pr = vtk.vtkProperty()
        pr.DeepCopy(self.GetProperty())
        cloned.SetProperty(pr)
        return cloned
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()))
1311863
def compare_last_two_snapshots(obj, raw=False):
    

    if get_snapshot_count(obj) < 2:
        return {}

    version = get_version(obj)

    snap1 = get_snapshot_by_version(obj, version - 1)
    snap2 = get_snapshot_by_version(obj, version)

    return compare_snapshots(snap1, snap2, raw=raw)