def _parse_currency(value):
 if (not isinstance(value, dict)):
  value = currency.match(value).groupdict()
 value['amount'] = Decimal(value['amount'])
 return value

def _parse_currency ( value ) : if ( not isinstance ( value , dict ) ) : value = currency . match ( value ) . groupdict ( ) value [ 'amount' ] = Decimal ( value [ 'amount' ] ) return value
parse usd 10 .