Prepare the object to be sent over the untrusted channel.
542438
def _prepare(self, serialized_obj):
        '''
        
        '''
        # generating a nonce
        nonce = nacl.utils.random(nacl.secret.SecretBox.NONCE_SIZE)
        # encrypting using the nonce
        encrypted = self.__safe.encrypt(serialized_obj, nonce)
        # sign the message
        signed = self.__signing_key.sign(encrypted)
        return signed
888774
protected function preparePrep(){
        $this->prepList = array();
        $this->invalidList = array();
        $this->rewind();
        if (array_key_exists('SellerSKUList.Id.1',$this->options)){
            $this->options['Action'] = 'GetPrepInstructionsForSKU';
            $this->resetASINs();
        } else if (array_key_exists('ASINList.Id.1',$this->options)){
            $this->options['Action'] = 'GetPrepInstructionsForASIN';
            $this->resetSKUs();
        }
    }
1332004
protected void prepareMandArcDetection() {
		// RECYCLING ccTp is used to model the compressed path
		ISet nei;
		for (int i = 0; i < n; i++) {
			ccTp[i] = -1;
		}
		useful.clear();
		useful.set(0);
		int k = 1;
		useful.set(k);
		ccTp[k] = k;
		int first = 0;
		int last = first;
		fifo[last++] = k;
		while (first < last) {
			k = fifo[first++];
			nei = Tree.getNeighOf(k);
			for (int s : nei) {
				if (ccTp[s] == -1) {
					ccTp[s] = k;
					map[s][k] = map[k][s] = -1;
					if (!useful.get(s)) {
						fifo[last++] = s;
						useful.set(s);
					}
				}
			}
		}
	}
1323605
private function prepareToRendering() {
		$this->tm()->confirmed() ? $this->prepare() : $this->prepareUnconfirmed();
		if ($this->isTest()) {
			$this->si('Mode', __($this->testModeLabel()));
		}
		$this->prepareDic();
		$this->dic()->sort();
	}
774368
def pre_fork(self, _):
        '''
        
        '''
        if 'aes' not in salt.master.SMaster.secrets:
            # TODO: This is still needed only for the unit tests
            # 'tcp_test.py' and 'zeromq_test.py'. Fix that. In normal
            # cases, 'aes' is already set in the secrets.
            salt.master.SMaster.secrets['aes'] = {
                'secret': multiprocessing.Array(
                    ctypes.c_char,
                    salt.utils.stringutils.to_bytes(salt.crypt.Crypticle.generate_key_string())
                ),
                'reload': salt.crypt.Crypticle.generate_key_string
            }
907008
private void prepareForReuse(boolean reuse)
    {
        if(reuse)
        {
            // using clone to avoid ConcurentModificationException
            Iterator iter = ((List) mvOrderOfIds.clone()).iterator();
            while(iter.hasNext())
            {
                ObjectEnvelope mod = (ObjectEnvelope) mhtObjectEnvelopes.get(iter.next());
                if(!needsCommit || (mod.getModificationState() == StateOldClean.getInstance()
                        || mod.getModificationState().isTransient()))
                {
                    // nothing to do
                }
                else
                {
                    mod.setModificationState(mod.getModificationState().markClean());
                }
            }
        }
    }
458479
function prepare(data, consumerkey) {
	var prop;
	data = data || {};

	for (prop in data) {
		if (data.hasOwnProperty(prop)) {
			if (_.isDate(data[prop])) {
				data[prop] = helpers.toYYYYMMDD(data[prop]);
			}
		}
	}

	data.oauth_consumer_key = consumerkey;

	return data;
}
324398
def prepare(self):
        
        requested_access = self.endpoint_access(self.request.method)
        use_oauth = getattr(options, 'use_oauth', None)
        if use_oauth and requested_access is not self.UNAUTHENTICATED_ACCESS:
            token = self.request.headers.get('Authorization', '').split(' ')[-1]
            if token:
                has_access = yield self.verify_token(token, requested_access)
                if not has_access:
                    msg = "'{}' access not granted.".format(requested_access)
                    raise HTTPError(403, msg)
            else:
                msg = 'OAuth token not provided'
                raise HTTPError(401, msg)
544587
def _prepare_request(self, url, method, headers, data):
        

        request = httpclient.HTTPRequest(
            url=url, method=method, headers=headers, body=data,
            connect_timeout=self._connect_timeout,
            request_timeout=self._request_timeout,
            auth_username=self._username, auth_password=self._password,
            client_cert=self._client_cert, client_key=self._client_key,
            ca_certs=self._ca_certs, validate_cert=self._verify_cert)

        return request
1334348
def prepare(self):
        """"""
        p = PreparedRequest()
        p.prepare(
            method=self.method,
            url=self.url,
            headers=self.headers,
            files=self.files,
            data=self.data,
            params=self.params,
            auth=self.auth,
            cookies=self.cookies,
            hooks=self.hooks,
        )
        return p
820297
def prepare(self):
        
        super(RequestHandler, self).prepare()
        if self.request.headers.get('content-type', '').startswith(self.JSON):
            self.request.body = escape.json_decode(self.request.body)
521575
def on_trap(object_id, &block)
      raise ArgumentError, "a block must be provided" unless block
      @lock.synchronize { @oid_handler[ObjectId.new(object_id)] = block }
    end
243231
def prepare(self):
		""""""
		self.scope = 0
		self.mapping = deque([0])
		self._handler = [i() for i in sorted(self.handlers, key=lambda handler: handler.priority)]
83286
public function prepare()
        {
            $this->setCurlOption(CURLOPT_CUSTOMREQUEST, 'PUT');

            if(isset($this->options['data'])) {
                // Data
                $data = (isset($this->options['is_payload']) && $this->options['is_payload'] === true) ? json_encode($this->options['data']) : http_build_query($this->options['data']);

                $this->setCurlOption(CURLOPT_POSTFIELDS, $data);
            }
        }
1195364
private Message prepare(String channel, Message message, Recipient[] recipients) {
        message.setMetadata("cwf.pub.node", nodeId);
        message.setMetadata("cwf.pub.channel", channel);
        message.setMetadata("cwf.pub.event", UUID.randomUUID().toString());
        message.setMetadata("cwf.pub.when", System.currentTimeMillis());
        message.setMetadata("cwf.pub.recipients", recipients);
        return message;
    }
1170978
protected void prepareIO() {
        // we assume that everything in ByteArray is in AMF3
        Input input = new Input(data);
        input.enforceAMF3();
        dataInput = new DataInput(input);
        Output output = new Output(data);
        output.enforceAMF3();
        dataOutput = new DataOutput(output);
    }
830046
private final void prepareObject(ZooPC obj, long oid, boolean hollow, 
    		ZooClassDef classDef) {
//        obj.jdoNewInstance(sm); //?
        
        if (hollow) {
        	cache.addToCache(obj, classDef, oid, ObjectState.HOLLOW_PERSISTENT_NONTRANSACTIONAL);
        } else {
        	cache.addToCache(obj, classDef, oid, ObjectState.PERSISTENT_CLEAN);
        }
    }