Sets basket parameters to request.
343714
public function addBasketParams()
    {
        $request = $this->getPayPalRequest();
        $basket = $this->getBasket();

        $virtualBasket = $basket->isVirtualPayPalBasket();

        // only downloadable products? missing getter on oxBasket yet
        $request->setParameter("NOSHIPPING", $virtualBasket ? "1" : "0");

        if ($virtualBasket) {
            $request->setParameter("REQCONFIRMSHIPPING", "0");
        }
        // passing basket VAT (tax) value. It is required as in Net mode articles are without VAT, but basket is with VAT.
        // PayPal need this value to check if all articles sum match basket sum.
        if ($basket->isCalculationModeNetto()) {
            $request->setParameter("PAYMENTREQUEST_0_TAXAMT", $this->formatFloat($basket->getPayPalBasketVatValue()));
        }

        $request->setParameter("PAYMENTREQUEST_0_AMT", $this->formatFloat($basket->getPrice()->getBruttoPrice()));
        $request->setParameter("PAYMENTREQUEST_0_CURRENCYCODE", $basket->getBasketCurrency()->name);
        $request->setParameter("PAYMENTREQUEST_0_ITEMAMT", $this->formatFloat($basket->getSumOfCostOfAllItemsPayPalBasket()));
        $request->setParameter("PAYMENTREQUEST_0_SHIPPINGAMT", $this->formatFloat($basket->getDeliveryCosts()));
        $request->setParameter("PAYMENTREQUEST_0_SHIPDISCAMT", $this->formatFloat($basket->getDiscountSumPayPalBasket() * -1));

        $delivery = oxNew(\OxidEsales\Eshop\Application\Model\DeliverySet::class);
        $deliveryName = ($delivery->load($basket->getShippingId())) ? $delivery->oxdeliveryset__oxtitle->value : "#1";

        $request->setParameter("L_SHIPPINGOPTIONISDEFAULT0", "true");
        $request->setParameter("L_SHIPPINGOPTIONNAME0", $deliveryName);
        $request->setParameter("L_SHIPPINGOPTIONAMOUNT0", $this->formatFloat($basket->getDeliveryCosts()));
    }
188347
def set_parameters(self):
        
        for key in dir(self):
            if key.startswith('REQUIRES_'):
                setattr(self, key, getattr(self.gmpe, key))
            if key.startswith('DEFINED_'):
                if not key.endswith('FOR_INTENSITY_MEASURE_TYPES'):
                    setattr(self, key, getattr(self.gmpe, key))
20168
def prepare_params(request):
    """"""
    return request.replace(
        params={key: dump_param(val) for key, val in request.params.items()
                if val is not None})
663146
def set_requests_per_second(self, req_per_second):
        ''''''
        self.req_per_second = req_per_second
        self.req_duration = 1 / self.req_per_second
1116143
def bulk_update(self, request):
        
        # Delete everything in the basket
        bid = utils.destroy_basket(request)

        for item_data in request.data:
            item = BasketItem(basket_id=bid, **item_data)
            item.save()

        serializer = BasketItemSerializer(self.get_queryset(request), many=True)
        response = Response(data=serializer.data,
                            status=status.HTTP_200_OK)
        return response
97744
void updateRequestWithV1Params(JSONObject requestObj) {
        try {
            SystemObserver.UniqueId hardwareID = getHardwareID();
            if (!isNullOrEmptyOrBlank(hardwareID.getId())) {
                requestObj.put(Defines.Jsonkey.HardwareID.getKey(), hardwareID.getId());
                requestObj.put(Defines.Jsonkey.IsHardwareIDReal.getKey(), hardwareID.isReal());
            }

            String brandName = SystemObserver.getPhoneBrand();
            if (!isNullOrEmptyOrBlank(brandName)) {
                requestObj.put(Defines.Jsonkey.Brand.getKey(), brandName);
            }

            String modelName = SystemObserver.getPhoneModel();
            if (!isNullOrEmptyOrBlank(modelName)) {
                requestObj.put(Defines.Jsonkey.Model.getKey(), modelName);
            }

            DisplayMetrics displayMetrics = SystemObserver.getScreenDisplay(context_);
            requestObj.put(Defines.Jsonkey.ScreenDpi.getKey(), displayMetrics.densityDpi);
            requestObj.put(Defines.Jsonkey.ScreenHeight.getKey(), displayMetrics.heightPixels);
            requestObj.put(Defines.Jsonkey.ScreenWidth.getKey(), displayMetrics.widthPixels);

            requestObj.put(Defines.Jsonkey.WiFi.getKey(), SystemObserver.getWifiConnected(context_));
            requestObj.put(Defines.Jsonkey.UIMode.getKey(), SystemObserver.getUIMode(context_));

            String osName = SystemObserver.getOS();
            if (!isNullOrEmptyOrBlank(osName)) {
                requestObj.put(Defines.Jsonkey.OS.getKey(), osName);
            }

            requestObj.put(Defines.Jsonkey.OSVersion.getKey(), SystemObserver.getOSVersion());

            String countryCode = SystemObserver.getISO2CountryCode();
            if (!TextUtils.isEmpty(countryCode)) {
                requestObj.put(Defines.Jsonkey.Country.getKey(), countryCode);
            }

            String languageCode = SystemObserver.getISO2LanguageCode();
            if (!TextUtils.isEmpty(languageCode)) {
                requestObj.put(Defines.Jsonkey.Language.getKey(), languageCode);
            }

            String localIpAddr = SystemObserver.getLocalIPAddress();
            if ((!TextUtils.isEmpty(localIpAddr))) {
                requestObj.put(Defines.Jsonkey.LocalIP.getKey(), localIpAddr);
            }

        } catch (JSONException ignore) {

        }
    }
563080
def set_params(self, subs=None, numticks=None):
        
        if numticks is not None:
            self.numticks = numticks
        if subs is not None:
            self._subs = subs
1115091
public function addBasketItemParams()
    {
        $basket = $this->getBasket();
        $lang = $this->getLang();
        $request = $this->getPayPalRequest();

        $pos = 0;
        foreach ($basket->getContents() as $basketItem) {
            $request->setParameter("L_PAYMENTREQUEST_0_NAME{$pos}", \OxidEsales\Eshop\Core\Str::getStr()->html_entity_decode($basketItem->getTitle()));
            $request->setParameter("L_PAYMENTREQUEST_0_AMT{$pos}", $this->formatFloat($basketItem->getUnitPrice()->getPrice()));
            $request->setParameter("L_PAYMENTREQUEST_0_QTY{$pos}", (int) $basketItem->getAmount());
            $request->setParameter("L_PAYMENTREQUEST_0_ITEMURL{$pos}", $basketItem->getLink());

            $basketProduct = $basketItem->getArticle();
            $request->setParameter("L_PAYMENTREQUEST_0_NUMBER{$pos}", $basketProduct->oxarticles__oxartnum->value);

            $pos++;
        }

        //adding payment costs as product
        if ($basket->getPayPalPaymentCosts() > 0) {
            $paymentTitle = $lang->translateString("OEPAYPAL_SURCHARGE") . " " . $lang->translateString("OEPAYPAL_TYPE_OF_PAYMENT");
            $request->setParameter("L_PAYMENTREQUEST_0_NAME{$pos}", $paymentTitle);
            $request->setParameter("L_PAYMENTREQUEST_0_AMT{$pos}", $this->formatFloat($basket->getPayPalPaymentCosts()));
            $request->setParameter("L_PAYMENTREQUEST_0_QTY{$pos}", 1);

            $pos++;
        }

        //adding wrapping as product
        if ($basket->getPayPalWrappingCosts() > 0) {
            $request->setParameter("L_PAYMENTREQUEST_0_NAME{$pos}", $lang->translateString("OEPAYPAL_GIFTWRAPPER"));
            $request->setParameter("L_PAYMENTREQUEST_0_AMT{$pos}", $this->formatFloat($basket->getPayPalWrappingCosts()));
            $request->setParameter("L_PAYMENTREQUEST_0_QTY{$pos}", 1);

            $pos++;
        }

        //adding greeting card as product
        if ($basket->getPayPalGiftCardCosts() > 0) {
            $request->setParameter("L_PAYMENTREQUEST_0_NAME{$pos}", $lang->translateString("OEPAYPAL_GREETING_CARD"));
            $request->setParameter("L_PAYMENTREQUEST_0_AMT{$pos}", $this->formatFloat($basket->getPayPalGiftCardCosts()));
            $request->setParameter("L_PAYMENTREQUEST_0_QTY{$pos}", 1);

            $pos++;
        }
    }
299665
def set_parameter_values(self, values):
        
        req = rest_pb2.BulkSetParameterValueRequest()
        for key in values:
            item = req.request.add()
            item.id.MergeFrom(_build_named_object_id(key))
            item.value.MergeFrom(_build_value_proto(values[key]))
        url = '/processors/{}/{}/parameters/mset'.format(
            self._instance, self._processor)
        self._client.post_proto(url, data=req.SerializeToString())
1304012
def set_request(self, r):
        
        for k in self.environments.keys():
            self.environments[k].globals['REQUEST'] = r
619293
def set_parameter(self, name, values, group_id=None):
        
        if not isinstance(values, list):
            values = [values]
        if group_id is None:
            self.params.append({'name': name, 'values': values})
        else:
            self.params.append({'name': name, 'groupId': group_id, 'values': values})
249229
def set_param(self, name, value):
        
        if name not in self.param_names:
            raise ValueError('No GO-PCA Server parameter named "%s"!' %(param))
        self.__params[name] = value
112218
def required_params(data, *r_params):
    

    if not reduce(lambda still_valid, param: still_valid and param in data,
                  r_params, True):
        raise RequestException(msg_err_missing_params(*r_params))
501110
def _set_hyperparameters(self, parameters):
        """"""
        for name, value in parameters.iteritems():
            try:
                getattr(self, name)
            except AttributeError:
                raise ValueError(
                    'Each parameter in parameters must be an attribute. '
                    '{} is not.'.format(name))
            setattr(self, name, value)
1342387
def build_parameters(request, meta, orgaMode, currentOrga):
    """"""

    postParameters = {}
    getParameters = {}
    files = {}

    def update_parameters(data):
        tmp_getParameters, tmp_postParameters, tmp_files = data

        getParameters.update(tmp_getParameters)
        postParameters.update(tmp_postParameters)
        files.update(tmp_files)

    update_parameters(build_base_parameters(request))
    update_parameters(build_user_requested_parameters(request, meta))
    update_parameters(build_orga_parameters(request, orgaMode, currentOrga))

    return (getParameters, postParameters, files)
583598
def set_params(self, **params):
        
        if self._solr_locked:
            raise Exception("Query already executed, no changes can be made."
                            "%s %s" % (self._solr_query, self._solr_params)
                            )
        self._solr_params.update(params)
870996
def putParamset(self, remote, address, paramset, value):
        """"""
        try:
            return self.proxies["%s-%s" % (self._interface_id, remote)].putParamset(address, paramset, value)
        except Exception as err:
            LOG.debug("ServerThread.putParamset: Exception: %s" % str(err))