Creates the restore serializer from the pos-th config snapshot.
765337
public <T> TypeSerializer<T> getRestoredNestedSerializer(int pos) {
		checkArgument(pos < nestedSnapshots.length);

		@SuppressWarnings("unchecked")
		TypeSerializerSnapshot<T> snapshot = (TypeSerializerSnapshot<T>) nestedSnapshots[pos];

		return snapshot.restoreSerializer();
	}
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
712590
def _create_serializer(self) -> JsonObjectSerializer:
        
        if self._serializer_cache is None:
            serializer_cls = type(
                "%sInternalSerializer" % type(self),
                (JsonObjectSerializer,),
                {
                    "_JSON_ENCODER_ARGS": self._args,
                    "_JSON_ENCODER_KWARGS": self._kwargs
                }
            )
            self._serializer_cache = serializer_cls(self._get_property_mappings())
        return self._serializer_cache
528344
def serialize(cls, obj):
        

        cls._initialize()
        serializer = cls._get_serializer(type(obj))

        if serializer == cls:
            return cls._serialize_default(obj)
        else:
            return serializer.serialize(obj)
894105
def serialize(self, obj, method='json', beautify=False, raise_exception=False):
        """"""

        return self.helper.string.serialization.serialize(
            obj=obj, method=method, beautify=beautify, raise_exception=raise_exception)
956010
def start_from_snapshot(self, name):
        
        _, r = self.datacenter.request('POST', self.path + '/snapshots/' + 
            str(name))
        r.raise_for_status()
        return self
367532
def to_json(self):
        

        result = super(Snapshot, self).to_json()
        result.update({
            'snapshot': self.snapshot.to_json(),
        })
        return result
1368803
private static JaxbJsonSerializer<Map<String, String>> getPropsSerializer() {
        return new JaxbJsonSerializer<>((Class<Map<String, String>>) (Object)
            new HashMap<String, String>().getClass());
    }
1043490
public static RequestRestoreSnapshotParameters deserialize(String taskParameters) {
        JaxbJsonSerializer<RequestRestoreSnapshotParameters> serializer =
            new JaxbJsonSerializer<>(RequestRestoreSnapshotParameters.class);
        try {
            RequestRestoreSnapshotParameters params =
                serializer.deserialize(taskParameters);
            // Verify expected parameters
            if (null == params.getSnapshotId() || params.getSnapshotId().isEmpty()) {
                throw new SnapshotDataException(
                    "Task parameter values may not be empty");
            }
            return params;
        } catch (IOException e) {
            throw new SnapshotDataException(
                "Unable to parse task parameters due to: " + e.getMessage());
        }
    }
29390
def create_refobj(self, ):
        
        n = cmds.createNode("jb_reftrack")
        cmds.lockNode(n, lock=True)
        return n
731182
public void restore(ObjectInputStream ois, int dataVersion)
  throws SevereMessageStoreException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc,
        "restore",
        new Object[] { ois, new Integer(dataVersion) });

   // checkPersistentVersionId(dataVersion);
    if (dataVersion > getPersistentVersion())
    {

      SibTr.error(tc, "ITEM_RESTORE_ERROR_CWSIP0261",
        new Object[] {new Integer(getPersistentVersion()),
                      new Integer(dataVersion)});

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "restore", "SIErrorException");

      throw new SevereMessageStoreException(
        nls.getFormattedMessage(
          "ITEM_RESTORE_ERROR_CWSIP0261",
          new Object[] {new Integer(getPersistentVersion()),
                        new Integer(dataVersion) },
          null));
    }

    BaseDestinationHandler baseDestHandler = null;

    PubSubMessageItemStream mis = (PubSubMessageItemStream)getItemStream();
    baseDestHandler  = (BaseDestinationHandler)mis.getItemStream();
    if (baseDestHandler != null) _destinationManager = baseDestHandler.getDestinationManager();

    // F001333-14610
    // Make sure we set the durable flag on our subState
    _subState.setDurable(true);

    //first we initialize the persistent data
    try
    {
      HashMap hm = (HashMap)ois.readObject();
      _subState.setSubscriberID((String)hm.get("subscriberID"));
      _subState.setTopicSpaceUuid(new SIBUuid12((String)hm.get("topicspace")));
      _subState.setTopicSpaceName((String)hm.get("topicspaceName"));
      _subState.setTopicSpaceBusName((String)hm.get("topicspaceBusName"));
      toBeDeleted = ((Boolean)hm.get("isToBeDeleted")).booleanValue();

      boolean isSIBServerSubject = ((Boolean)hm.get("isSIBServerSubject")).booleanValue();
      _subState.setUser((String)hm.get("user"), isSIBServerSubject);
      _topics = (String[])hm.get("topics");
      _subState.setIsCloned(((Boolean)hm.get("isCloned")).booleanValue());
      _subState.setNoLocal(((Boolean)hm.get("isNoLocal")).booleanValue());

      // selectorStrings and domains arrived in version 1 of DurableSubscriptionItemStreams
      if( dataVersion < 2 )
      {
        if (_selectors == null)
          this._selectors = new String[1];

        if (_domains == null)
          this._domains = new int[1];

        this._selectors[0] = (String)hm.get("selectorstring");
        this._domains[0] = ((Integer)hm.get("selectordomain")).intValue();
      }
      else
      {
        _subState.setTargetDestination((String)hm.get("targetDestination"));
        this._selectors = (String[])hm.get("selectors");
        this._domains = (int[])hm.get("domains");
        this._selectorProperties = (HashMap[])hm.get("selectorProperties");
        this._subState.setUserData((HashMap)hm.get("userData"));        
      }
      
      // SelectorProperties arrived in version 2 of DurableSubscriptionItemStreams
      if( dataVersion < PERSISTENT_VERSION)
      {
        if(_selectorProperties == null)
          this._selectorProperties = new HashMap[1];        
      }
      else
      {
        this._selectorProperties = (HashMap[])hm.get("selectorProperties");
      }
    }
    catch (Exception e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.store.itemstreams.DurableSubscriptionItemStream.restore",
        "1:434:1.95",
        this);

      SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "restore", e);

      throw new SIErrorException(
        nls.getFormattedMessage(
        "SUBSCRIPTION_WARM_START_ERROR_CWSIP0148",
        new Object[] { _destinationManager.getLocalME().getMessagingEngineName(), e },
          null),
        e);
    }

    if(baseDestHandler==null || _destinationManager==null)
    {
      //MP has not been initialized so we must put the stream into doubt
      _inDoubt=true;
    }
    else
    {
      initializeNonPersistent(baseDestHandler);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "restore");
  }
703839
private function createSerializer()
    {
        return SerializerBuilder::create()
            ->setPropertyNamingStrategy(new IdenticalPropertyNamingStrategy())
            ->configureListeners(function (EventDispatcher $dispatcher) {
                $dispatcher->addListener('serializer.post_deserialize',
                    function (ObjectEvent $event) {
                        $object = $event->getObject();
                        if ($object instanceof ClientAwareInterface) {
                            $object->setClient($this);
                        }
                    }
                );

                $dispatcher->addListener('serializer.post_serialize',
                    function (ObjectEvent $event) {
                        $options = $event->getContext()->attributes->get('options')->getOrElse(array());
                        $visitor = $event->getVisitor();

                        if ($visitor instanceof GenericSerializationVisitor) {
                            foreach ($options as $key => $value) {
                                $visitor->addData($key, $value);
                            }
                        }
                    }
                );
            })
            ->build();
    }
216186
def make_ops_snapshot( cls, serialized_ops ):
        
        record_hashes = []
        for serialized_op in serialized_ops:
            record_hash = bin_double_sha256( serialized_op ).encode('hex')
            record_hashes.append(record_hash)

        if len(record_hashes) == 0:
            record_hashes.append(bin_double_sha256("").encode('hex'))

        # put records into their own Merkle tree, and mix the root with the consensus hashes.
        record_hashes.sort()
        record_merkle_tree = MerkleTree( record_hashes )
        record_root_hash = record_merkle_tree.root()

        return record_root_hash
995849
@Override
    public Restoration restoreSnapshot(String snapshotId,
                                       DuracloudEndPointConfig destination,
                                       String userEmail)
        throws SnapshotNotFoundException, SnapshotInProcessException, SnapshotException {

        checkInitialized();

        Snapshot snapshot = getSnapshot(snapshotId);

        if (!snapshot.getStatus().equals(SnapshotStatus.SNAPSHOT_COMPLETE)) {
            throw new SnapshotInProcessException("Snapshot is not complete. " +
                                                 "Restoration can only occur on a " +
                                                 "completed snapshot.");
        }

        Restoration restoration =
            createRestoration(snapshot, destination, userEmail);

        validateAndSet(restoration, RestoreStatus.RETRIEVING_FROM_STORAGE, "Restoration request issued");

        restoration = save(restoration);

        String restorationId = restoration.getRestorationId();
        File restoreDir = getRestoreDir(restorationId);
        restoreDir.mkdirs();

        //send email to snapshot storage owner to request restore
        String subject = "Snapshot Restoration Request for Snapshot ID = " +
                         snapshotId;
        String body = "Please perform a snapshot restore.\n" +
                      "\nSnapshot ID: " + snapshotId +
                      "\nRestore ID: " + restorationId +
                      "\nRestore Location: " + restoreDir.getAbsolutePath();
        notificationManager.sendNotification(NotificationType.EMAIL,
                                             subject,
                                             body,
                                             getAllEMailAddresses(this.config));
        return restoration;
    }
1058005
public Serializer getSerializer(Class cls) {
    SerializerWrapper w = getSerializerWrapper(cls);
    if (w != null) {
      return w.serializer;
    }
    return null;
  }
1358003
public String serialize() {
        JaxbJsonSerializer<CreateSnapshotBridgeParameters> serializer =
            new JaxbJsonSerializer<>(CreateSnapshotBridgeParameters.class);
        try {
            return serializer.serialize(this);
        } catch (IOException e) {
            throw new SnapshotDataException(
                "Unable to create task result due to: " + e.getMessage());
        }
    }
668195
function createSerializer(serializer) {
  var applyFn = function serializationWrapper(v, cb) {
    try {
      return cb ? serializer(v, cb) : serializer(v);
    } catch (e) {
      var modifiedError = new Error('Could not serialize value: ' + e.message);
      modifiedError.value = v;
      modifiedError.serializer = serializer;
      throw modifiedError;
    }
  };

  // We can check how many parameters the function has and activate the asynchronous
  // operation if the number of parameters the function accepts is > 1
  return {
    apply: applyFn,
    async: serializer.length > 1
  };
}