Convert GetCompetitivePricingForASINRequest to name value pairs
356799
private function _convertGetCompetitivePricingForASIN($request) {

        $parameters = array();
        $parameters['Action'] = 'GetCompetitivePricingForASIN';
        if ($request->isSetSellerId()) {
            $parameters['SellerId'] =  $request->getSellerId();
        }
        if ($request->isSetMWSAuthToken()) {
            $parameters['MWSAuthToken'] =  $request->getMWSAuthToken();
        }
        if ($request->isSetMarketplaceId()) {
            $parameters['MarketplaceId'] =  $request->getMarketplaceId();
        }
        if ($request->isSetASINList()) {
            $ASINListGetCompetitivePricingForASINRequest = $request->getASINList();
            foreach  ($ASINListGetCompetitivePricingForASINRequest->getASIN() as $ASINASINListIndex => $ASINASINList) {
                $parameters['ASINList' . '.' . 'ASIN' . '.'  . ($ASINASINListIndex + 1)] =  $ASINASINList;
            }
        }

        return $parameters;
    }
392904
def get_comparable_values(self):
        
        return (str(self.name), str(self.description), str(self.type), bool(self.optional), str(self.constraints) if isinstance(self, Constraintable) else "")
159662
def value_name(cls, value):
        
        for k, v in list(cls.__dict__.items()):
            if v == value:
                return k
        return value
972588
def ConvertToWireFormat(self, value):
    """"""
    # Is it a protobuf-based value?
    if hasattr(value.__class__, "protobuf"):
      if value.__class__.protobuf:
        type_name = ("type.googleapis.com/%s" %
                     value.__class__.protobuf.__name__)
      else:
        type_name = value.__class__.__name__
      data = value.SerializeToString()
    # Is it a primitive value?
    elif hasattr(value.__class__, "data_store_type"):
      wrapper_cls = self.__class__.WRAPPER_BY_TYPE[
          value.__class__.data_store_type]
      wrapped_data = wrapper_cls()
      wrapped_data.value = value.SerializeToDataStore()

      type_name = ("type.googleapis.com/google.protobuf.%s" %
                   wrapper_cls.__name__)
      data = wrapped_data.SerializeToString()
    else:
      raise ValueError("Can't convert value %s to an protobuf.Any value." %
                       value)

    any_value = AnyValue(type_url=type_name, value=data)
    output = _SerializeEntries(_GetOrderedEntries(any_value.GetRawData()))

    return (self.encoded_tag, VarintEncode(len(output)), output)
228498
public static String calculateSignString(PayReq request, String privKey) {
        return rsaSign(getStringForSign(request), privKey);
    }
1135028
def get(self, name, default=_MISSING):
        """"""
        name = self._convert_name(name)
        if name not in self._fields:
            if default is _MISSING:
                default = self._default_value(name)
            return default
        if name in _UNICODEFIELDS:
            value = self._fields[name]
            return value
        elif name in _LISTFIELDS:
            value = self._fields[name]
            if value is None:
                return []
            res = []
            for val in value:
                if name not in _LISTTUPLEFIELDS:
                    res.append(val)
                else:
                    # That's for Project-URL
                    res.append((val[0], val[1]))
            return res

        elif name in _ELEMENTSFIELD:
            value = self._fields[name]
            if isinstance(value, string_types):
                return value.split(',')
        return self._fields[name]
753066
public int getIntReqPar(final String name,
                          final int defaultVal) throws Throwable {
    String reqpar = getReqPar(name);

    if (reqpar == null) {
      return defaultVal;
    }

    try {
      return Integer.parseInt(reqpar);
    } catch (Throwable t) {
      return defaultVal; // XXX exception?
    }
  }
152461
def _to_api_value(self, attribute_type, value):
        """"""

        if not value:
            return None

        if isinstance(attribute_type, properties.Instance):
            return value.to_api()

        if isinstance(attribute_type, properties.List):
            return self._parse_api_value_list(value)

        return attribute_type.serialize(value)
893501
@SuppressWarnings("unused")
    private void parseCustomBusinessValuesOld(BusinessValueList bvlXml,
            IBusinessValueList businessValueList) throws JAXBException {
        if (bvlXml.getCustomBusinessValue() != null) {
            for (Object bvlItem : bvlXml.getCustomBusinessValue()) {
                CustomBusinessValue item = (CustomBusinessValue) um.unmarshal((Node) bvlItem);
                
                for (Penalty action: item.getPenalties()) {
                    
                    IPenaltyDefinition penaltyDef = newPenaltyDefinition(item, action);
                    businessValueList.addPenalty(penaltyDef);
                }
            }
        }
    }
796568
@SuppressWarnings("unchecked")
    private <T> Optional<T> getValue(Object object, Supplier<Object> method, Class<T> cls) {

        T source = null;
        if (cls.isInstance(method.get())) {
            source = (T) method.get();
        } else {
            if (CoreParameters.DEVELOPER_MODE.get()) {
                throw new CoreRuntimeException("Cannot cast object " + method.get() + " to " + cls.toGenericString());
            }
        }
        return Optional.ofNullable(source);
    }
136671
@Override
  public final void process(final Map<String, Object> pReqVars,
    final IRequestData pRequestData) throws Exception {
    retrieveStartData(pReqVars);
    List<PriceCategory> defPcs = this.srvOrm.retrieveListWithConditions(pReqVars, PriceCategory.class, "where DFOL=1");
    if (defPcs.size() != 1) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE, "where_is_no_only_default_online_price_category");
    }
    SettingsAdd settingsAdd = (SettingsAdd) pReqVars.get("setAdd");
    TradingSettings tradSet = (TradingSettings) pReqVars.get("tradSet");
    GoodsInListLuv goodsInListLuv = (GoodsInListLuv) pReqVars.get("goodsInListLuv");
    pReqVars.remove("goodsInListLuv");
    String refreshAll = pRequestData.getParameter("refreshAll");
    List<GoodsSpecifics> goodsSpecificsLst;
    if (refreshAll != null) {
      goodsSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, GoodsSpecifics.class);
    } else {
      goodsSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getGoodsSpecificLuv(), GoodsSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, goodsSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nInvItem.class, EShopItemType.GOODS);
    pRequestData.setAttribute("totalUpdatedGdSp", goodsSpecificsLst.size());
    goodsSpecificsLst = null;
    List<PriceGoods> goodsPriceLst;
    if (refreshAll != null) {
      goodsPriceLst = retrieveItemPriceLst(pReqVars, null, PriceGoods.class, defPcs.get(0).getItsId());
    } else {
      goodsPriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getGoodsPriceLuv(), PriceGoods.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, goodsPriceLst, settingsAdd, goodsInListLuv, EShopItemType.GOODS);
    pRequestData.setAttribute("totalUpdatedGdPr", goodsPriceLst.size());
    goodsPriceLst = null;
    List<GoodsPlace> goodsPlaceLst;
    if (refreshAll != null) {
      goodsPlaceLst = retrieveItemPlaceLst(pReqVars, null, GoodsPlace.class);
    } else {
      goodsPlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getGoodsAvailableLuv(), GoodsPlace.class);
    }
    updateForItemPlaceList(pReqVars, goodsPlaceLst, settingsAdd, goodsInListLuv, EShopItemType.GOODS);
    pRequestData.setAttribute("totalUpdatedGdAv", goodsPlaceLst.size());
    goodsPlaceLst = null;
    List<ServiceSpecifics> serviceSpecificsLst;
    if (refreshAll != null) {
      serviceSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, ServiceSpecifics.class);
    } else {
      serviceSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getServiceSpecificLuv(), ServiceSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, serviceSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nServiceToSale.class, EShopItemType.SERVICE);
    pRequestData.setAttribute("totalUpdatedServSp", serviceSpecificsLst.size());
    serviceSpecificsLst = null;
    List<ServicePrice> servicePriceLst;
    if (refreshAll != null) {
      servicePriceLst = retrieveItemPriceLst(pReqVars, null, ServicePrice.class, defPcs.get(0).getItsId());
    } else {
      servicePriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getServicePriceLuv(), ServicePrice.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, servicePriceLst, settingsAdd, goodsInListLuv, EShopItemType.SERVICE);
    pRequestData.setAttribute("totalUpdatedServPr", servicePriceLst.size());
    servicePriceLst = null;
    List<ServicePlace> servicePlaceLst;
    if (refreshAll != null) {
      servicePlaceLst = retrieveItemPlaceLst(pReqVars, null, ServicePlace.class);
    } else {
      servicePlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getServicePlaceLuv(), ServicePlace.class);
    }
    updateForItemPlaceList(pReqVars, servicePlaceLst, settingsAdd, goodsInListLuv, EShopItemType.SERVICE);
    pRequestData.setAttribute("totalUpdatedServAv", servicePlaceLst.size());
    servicePlaceLst = null;
    List<SeGoodsSpecifics> seGoodSpecificsLst;
    if (refreshAll != null) {
      seGoodSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, SeGoodsSpecifics.class);
    } else {
      seGoodSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getSeGoodSpecificLuv(), SeGoodsSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, seGoodSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nSeGoods.class, EShopItemType.SEGOODS);
    pRequestData.setAttribute("totalUpdatedSeGoodSp", seGoodSpecificsLst.size());
    seGoodSpecificsLst = null;
    List<SeGoodsPrice> seGoodPriceLst;
    if (refreshAll != null) {
      seGoodPriceLst = retrieveItemPriceLst(pReqVars, null, SeGoodsPrice.class, defPcs.get(0).getItsId());
    } else {
      seGoodPriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getSeGoodPriceLuv(), SeGoodsPrice.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, seGoodPriceLst, settingsAdd, goodsInListLuv, EShopItemType.SEGOODS);
    pRequestData.setAttribute("totalUpdatedSeGoodPr", seGoodPriceLst.size());
    seGoodPriceLst = null;
    List<SeGoodsPlace> seGoodPlaceLst;
    if (refreshAll != null) {
      seGoodPlaceLst = retrieveItemPlaceLst(pReqVars, null, SeGoodsPlace.class);
    } else {
      seGoodPlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getSeGoodPlaceLuv(), SeGoodsPlace.class);
    }
    updateForItemPlaceList(pReqVars, seGoodPlaceLst, settingsAdd, goodsInListLuv, EShopItemType.SEGOODS);
    pRequestData.setAttribute("totalUpdatedSeGoodAv", seGoodPlaceLst.size());
    seGoodPlaceLst = null;
    List<SeServiceSpecifics> seServiceSpecificsLst;
    if (refreshAll != null) {
      seServiceSpecificsLst = retrieveItemSpecificsLst(pReqVars, null, SeServiceSpecifics.class);
    } else {
      seServiceSpecificsLst = retrieveItemSpecificsLst(pReqVars, goodsInListLuv.getSeServiceSpecificLuv(), SeServiceSpecifics.class);
    }
    updateForItemSpecificsList(pReqVars, seServiceSpecificsLst, settingsAdd, goodsInListLuv, tradSet, I18nSeService.class, EShopItemType.SESERVICE);
    pRequestData.setAttribute("totalUpdatedSeServiceSp", seServiceSpecificsLst.size());
    seServiceSpecificsLst = null;
    List<SeServicePrice> seServicePriceLst;
    if (refreshAll != null) {
      seServicePriceLst = retrieveItemPriceLst(pReqVars, null, SeServicePrice.class, defPcs.get(0).getItsId());
    } else {
      seServicePriceLst = retrieveItemPriceLst(pReqVars, goodsInListLuv.getSeServicePriceLuv(), SeServicePrice.class, defPcs.get(0).getItsId());
    }
    updateForItemPriceList(pReqVars, seServicePriceLst, settingsAdd, goodsInListLuv, EShopItemType.SESERVICE);
    pRequestData.setAttribute("totalUpdatedSeServicePr", seServicePriceLst.size());
    seServicePriceLst = null;
    List<SeServicePlace> seServicePlaceLst;
    if (refreshAll != null) {
      seServicePlaceLst = retrieveItemPlaceLst(pReqVars, null, SeServicePlace.class);
    } else {
      seServicePlaceLst = retrieveItemPlaceLst(pReqVars, goodsInListLuv.getSeServicePlaceLuv(), SeServicePlace.class);
    }
    updateForItemPlaceList(pReqVars, seServicePlaceLst, settingsAdd, goodsInListLuv, EShopItemType.SESERVICE);
    pRequestData.setAttribute("totalUpdatedSeServiceAv", seServicePlaceLst.size());
    seServicePlaceLst = null;
    pReqVars.remove("langPreferences");
  }
144021
def over(self, name='usd'):
        ''''''
        name = name.upper()
        if self.ccy1.code == name.upper():
            return ccy_pair(self.ccy2, self.ccy1)
        else:
            return self
612677
function getFormattedValues (formatString, rawValues) {
      var formattedValueString = formatString;
      var rawValuesLength = rawValues.length;

      for (var i = 0; i < rawValuesLength; i++) {
        formattedValueString = formattedValueString.replace(
          VALUE_PLACEHOLDER, +rawValues[i].toFixed(4));
      }

      return formattedValueString;
    }
260535
private String getLabelValue(final QName propName, final String attrPropsValue) {
        if (attrPropsValue != null) {
            int propStart = -1;
            if (attrPropsValue.startsWith(propName + "(") || attrPropsValue.contains(" " + propName + "(")) {
                propStart = attrPropsValue.indexOf(propName + "(");
            }
            if (propStart != -1) {
                propStart = propStart + propName.toString().length() + 1;
            }
            final int propEnd = attrPropsValue.indexOf(")", propStart);
            if (propStart != -1 && propEnd != -1) {
                return attrPropsValue.substring(propStart, propEnd).trim();
            }
        }
        return null;
    }
641575
@RequestMapping(value = "/listPriceByPeriod", method = RequestMethod.GET)
	
	public @ResponseBody
	JsonNode listPriceByPeriod(
			@RequestParam(value = "stockName", required = true) String stockName,
			@RequestParam(value = "period", required = true) PERIOD period) {
		logger.debug("Received request to list gedik stocks");
		
		JsonNode priceList = myNetFinansService.getPricesByPeriod(stockName, period);
		
		return priceList;

	}
833123
private static Optional<String> getMethodReturnValueName(ConstraintViolation<?> violation) {
        int returnValueNames = -1;

        final StringBuilder result = new StringBuilder("server response");
        for (Path.Node node : violation.getPropertyPath()) {
            if (node.getKind().equals(ElementKind.RETURN_VALUE)) {
                returnValueNames = 0;
            } else if (returnValueNames >= 0) {
                result.append(returnValueNames++ == 0 ? " " : ".").append(node);
            }
        }

        return returnValueNames >= 0 ? Optional.of(result.toString()) : Optional.empty();
    }
776901
private static String getReplierExportStrategyValue(ReplierExportStrategy replierExportStrategy, QueryReply queryReply) {
    if (queryReply != null) {
      User user = queryReply.getUser();
      if (user != null) {
        switch (replierExportStrategy) {
          case NONE:
          break;
          case HASH:
            return RequestUtils.md5EncodeString(String.valueOf(user.getId()));
          case NAME:
            return user.getFullName(true, false);
          case EMAIL:
            return user.getDefaultEmailAsString();
        }
      }
    }
    
    return "-";
  }