Parse supplemental currency data.
185275
private void parseSupplementalCurrencyData(JsonObject root) {
    JsonObject fractions = resolve(root, "supplemental", "currencyData", "fractions");
    for (String code : objectKeys(fractions)) {
      CurrencyData data = getCurrencyData(code);
      JsonObject node = fractions.get(code).getAsJsonObject();
      data.digits = Integer.valueOf(string(node, "_digits"));
      // Note: _rounding = 0 for all currencies in the modern data set.
    }
  }
1085645
def parse(self, data):
        """"""
        val = data.get(self.name, missing)
        if not isinstance(val, dict):
            return (self.operators['$eq'], self.field.deserialize(val)),

        return tuple(
            (
                self.operators[op],
                (self.field.deserialize(val)) if op not in self.list_ops else [
                    self.field.deserialize(v) for v in val])
            for (op, val) in val.items() if op in self.operators
        )
285412
def get_currencies(self):
        """"""
        try:
            resp = get(self.endpoint)
            resp.raise_for_status()
        except exceptions.RequestException as e:
            self.log(logging.ERROR, "%s: Problem whilst contacting endpoint:\n%s", self.name, e)
        else:
            with open(self._cached_currency_file, 'wb') as fd:
                fd.write(resp.content)

        try:
            root = ET.parse(self._cached_currency_file).getroot()
        except FileNotFoundError as e:
            raise RuntimeError("%s: XML not found at endpoint or as cached file:\n%s" % (self.name, e))

        return root
432718
def __parseKeyValueStore(self, data):
        """"""
        offset = 0
        key_value_store = {}
        while offset != len(data):
            key = get_str(data, offset)
            offset += len(key)+1

            value = get_str(data, offset)
            offset += len(value)+1

            key_value_store[key] = value

        return key_value_store
1324007
def parse_info(response):
    ""
    info = {}
    response = nativestr(response)

    def get_value(value):
        if ',' not in value or '=' not in value:
            try:
                if '.' in value:
                    return float(value)
                else:
                    return int(value)
            except ValueError:
                return value
        else:
            sub_dict = {}
            for item in value.split(','):
                k, v = item.rsplit('=', 1)
                sub_dict[k] = get_value(v)
            return sub_dict

    for line in response.splitlines():
        if line and not line.startswith('#'):
            if line.find(':') != -1:
                key, value = line.split(':', 1)
                info[key] = get_value(value)
            else:
                # if the line isn't splittable, append it to the "__raw__" key
                info.setdefault('__raw__', []).append(line)

    return info
759682
function parsePrice(s) {
  if (typeof s === 'number') return s;
  s = str(s).replace(/[\s,$]/g,'');
  return s ? Number(s) : NaN;
}
321736
private static List<String> getTenderCurrencies(CurrencyFilter filter) {
        CurrencyMetaInfo info = CurrencyMetaInfo.getInstance();
        return info.currencies(filter.withTender());
    }
101129
def currency_multiplier(src_currency, dest_currency):
    ''
    if src_currency == 'USD':
        return 1.0
    usd_mult = currency_rates()[src_currency]
    if dest_currency == 'USD':
        return usd_mult
    return usd_mult/currency_rates()[dest_currency]
1116666
def _parse_info(self, info_str, num_alts):
        """"""
        result = OrderedDict()
        if info_str == ".":
            return result
        # The standard is very nice to parsers, we can simply split at
        # semicolon characters, although I (Manuel) don't know how strict
        # programs follow this
        for entry in info_str.split(";"):
            if "=" not in entry:  # flag
                key = entry
                result[key] = parse_field_value(self.header.get_info_field_info(key), True)
            else:
                key, value = split_mapping(entry)
                result[key] = parse_field_value(self.header.get_info_field_info(key), value)
            self._info_checker.run(key, result[key], num_alts)
        return result
513353
function getCurrencySymbol(code, format, locale) {
    if (locale === void 0) { locale = 'en'; }
    var currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
    var symbolNarrow = currency[1 /* SymbolNarrow */];
    if (format === 'narrow' && typeof symbolNarrow === 'string') {
        return symbolNarrow;
    }
    return currency[0 /* Symbol */] || code;
}
788148
def parse_options(given, available):
    """"""
    for key, value in sorted(given.items()):
        if not value:
            continue
        if key in available:
            yield "--{0}={1}".format(key, value)
505055
def get_info(self, code):
        """"""
        for i, currency in enumerate(self.get_currency(code)):
            if i == 0:
                try:
                    exp = int(currency.find('CcyMnrUnts').text)
                except ValueError:
                    exp = 0
                info = {
                    'CountryNames': [],
                    'ISO4217Number': int(currency.find('CcyNbr').text),
                    'ISO4217Exponent': exp,
                    'ISOUpdate': self.published.isoformat(),
                }
            try:
                ctry_name = currency.find('CtryNm').text
            except AttributeError:
                continue
            if ctry_name:
                info['CountryNames'] += [ctry_name]
        return info
302225
def parse_value(self, value):
        """"""
        if value is None:
            return value
        if isinstance(value, datetime.time):
            return value
        return parse(value).timetz()
155484
public static function parseByDecimal($money, $forceCurrency = null, Currencies $currencies = null)
    {
        $parser = new DecimalMoneyParser($currencies ?: static::getCurrencies());

        return self::parseByParser($parser, $money, $forceCurrency);
    }
839136
def parse_value(self, value):
        """"""
        if not isinstance(value, dict):
            return value

        embed_type = self._get_embed_type()
        return embed_type(**value)
391605
protected function parseCurrencyArgument($data)
    {
        if (is_string($data)) {
            $currency = $data;
        } elseif (is_array($data)) {
            if (isset($data['country'])) {
                $currency = CountryToCurrency::getCurrency($data['country']);
            } elseif (isset($data['currency'])) {
                $currency = $data['currency'];
            } else {
                throw new Exception\InvalidArgumentException('Please provide country or currency!');
            }
        } else {
            throw new Exception\InvalidArgumentException('Invalid currency provided. String or array expected.');
        }

        return $currency;
    }
1184151
def user_parse(data):
        """"""
        _user = data.get('user_info', {})
        _id = _user.get('id') or _user.get('uid')
        yield 'id', _id
        yield 'locale', _user.get('default_lang')
        yield 'username', _user.get('display_name')
        first_name, _, last_name = _user.get('full_name', '').partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name
        yield 'picture', 'http://avatars.plurk.com/{0}-big2.jpg'.format(_id)
        city, country = map(lambda s: s.strip(),
                            _user.get('location', ',').split(','))
        yield 'city', city
        yield 'country', country