⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.30
Server IP:
45.79.8.107
Server:
Linux localhost 5.15.0-140-generic #150-Ubuntu SMP Sat Apr 12 06:00:09 UTC 2025 x86_64
Server Software:
nginx/1.18.0
PHP Version:
8.1.2-1ubuntu2.21
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
babel
/
__pycache__
/
View File Name :
numbers.cpython-310.pyc
o l:^ @ s& d Z ddlZddlmZmZ ddlZddlmZm Z m Z ddlmZm Z ze W n ey3 eZY nw edZG dd deZdLd d ZdLddZdLd dZdLddZdefddZefddZdd ZdefddZ dMddZefddZefdd Zefd!d"Zefd#d$Z efd%d&Z!efd'd(Z"d)d* Z#d+d, Z$dedfd-d.Z%G d/d0 d0e&Z'dedd1dfd2d3Z(dedd1dfd4d5Z)dedfd6d7Z*dedfd8d9Z+G d:d; d;e,Z-efd
d?Z/d@Z0dAZ1dBe0 Z2dCe1 Z3dDZ4e5dEe2e3e4f Z6dFdG Z7dHdI Z8G dJdK dKe9Z:dS )Na babel.numbers ~~~~~~~~~~~~~ Locale dependent formatting and parsing of numeric data. The default locale for the functions in this module is determined by the following environment variables, in that order: * ``LC_NUMERIC``, * ``LC_ALL``, and * ``LANG`` :copyright: (c) 2013-2019 by the Babel Team. :license: BSD, see LICENSE for more details. N)datedatetime)default_localeLocale get_global)decimalstring_types LC_NUMERICc @ s e Zd ZdZdd ZdS )UnknownCurrencyErrorzRException thrown when a currency is requested for which no data is available. c C s t | d| || _dS )zkCreate the exception. :param identifier: the identifier string of the unsupported currency zUnknown currency %r.N) Exception__init__ identifier)selfr r //usr/lib/python3/dist-packages/babel/numbers.pyr + s zUnknownCurrencyError.__init__N)__name__ __module____qualname____doc__r r r r r r ' s r c C s, | rt | j }t|S td}t|S )aM Return a `set` of normalized currency codes. .. versionadded:: 2.5.0 :param locale: filters returned currency codes by the provided locale. Expected to be a locale instance or code. If no locale is provided, returns the list of all currencies from all locales. Zall_currencies)r parse currencieskeysr set)localer r r r list_currencies5 s r c C s | t |vr t| dS )a Check the currency code is recognized by Babel. Accepts a ``locale`` parameter for fined-grained validation, working as the one defined above in ``list_currencies()`` method. Raises a `UnknownCurrencyError` exception if the currency is unknown to Babel. N)r r currencyr r r r validate_currencyG s r c C s8 | rt | ts dS zt| | W dS ty Y dS w )zy Returns `True` only if a currency is recognized by Babel. This method always return a Boolean and never raise. FT) isinstancer r r r r r r is_currencyS s r c C s$ t | tr | } t| |sdS | S )zReturns the normalized sting of any currency code. Accepts a ``locale`` parameter for fined-grained validation, working as the one defined above in ``list_currencies()`` method. Returns None if the currency is unknown to Babel. N)r r upperr r r r r normalize_currencya s r! c C sH t |}|dur||}|jd }| |v r|| | S |j| | S )a Return the name used by the locale for the specified currency. >>> get_currency_name('USD', locale='en_US') u'US Dollar' .. versionadded:: 0.9.4 :param currency: the currency code. :param count: the optional count. If provided the currency name will be pluralized to that number if possible. :param locale: the `Locale` object or locale identifier. NZcurrency_names_plural)r r plural_form_datar get)r countr locr" Zplural_namesr r r get_currency_namep s r' c C s t |j| | S )zReturn the symbol used by the locale for the specified currency. >>> get_currency_symbol('USD', locale='en_US') u'$' :param currency: the currency code. :param locale: the `Locale` object or locale identifier. )r r Zcurrency_symbolsr$ r r r r get_currency_symbol s r( c C s t d}|| |d d S )zReturn currency's precision. Precision is the number of decimals found after the decimal point in the currency's format pattern. .. versionadded:: 2.5.0 :param currency: the currency code. Zcurrency_fractionsZDEFAULTr )r r$ )r Z precisionsr r r get_currency_precision s r) c C sN t |}|dur ||}z|jd | W S ty Y nw |jd d S )aV Return the unit pattern used for long display of a currency value for a given locale. This is a string containing ``{0}`` where the numeric part should be substituted and ``{1}`` where the currency long display name should be substituted. >>> get_currency_unit_pattern('USD', locale='en_US', count=10) u'{0} {1}' .. versionadded:: 2.7.0 :param currency: the currency code. :param count: the optional count. If provided the unit pattern for that number will be returned. :param locale: the `Locale` object or locale identifier. NZcurrency_unit_patternsother)r r r" r# LookupError)r r% r r&