File: //home/arjun/projects/env/lib/python3.10/site-packages/babel/__pycache__/numbers.cpython-310.pyc
o
!we�� � @ s� d Z ddlmZ ddlZddlZddlZddlZddlmZm Z m
Z
mZ ddlm
Z
mZmZ ddlmZ er<ddlmZ ed�ZG d d
� d
e�Zd�d�dd�Zd�d�dd�Zd�d�dd�Zd�d�dd�Zdefd�dd�Zefd�d d!�Zd�d#d$�Zdefd�d%d&�Ze ' ' ' ' 'd�d�d1d2��Ze ' ' ' ' 'd�d�d5d2��Z 6 7 7d�d�d9d2�Zefd�d:d;�Z efd�d<d=�Z!efd�d>d?�Z"efd�d@dA�Z#efd�dBdC�Z$efd�dDdE�Z%efd�dHdI�Z&d�dKdL�Z'd�dOdP�Z(ded6d6fd�dUdV�Z)dWeddX�d�d\d]�Z*d�dbdc�Z+G ddde� dee,�Z-ded6dfd6d6fd�didj�Z.ded6dfd6d6fd�dkdl�Z/dWeddX�d�dndo�Z0ded6d6fd�dpdq�Z1ded6fd�drds�Z2G dtdu� due3�Z4efd�dwdx�Z5ed7fd�dzd{�Z6d|Z7d}Z8d~e7 Z9de8 Z:d�Z;e�<e9� e:� e;� ��Z=d�d�d��Z>d�d�d��Z?G d�d�� d��Z@dS )�a�
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-2023 by the Babel Team.
:license: BSD, see LICENSE for more details.
� )�annotationsN)�
TYPE_CHECKING�Any�cast�overload)�Locale�default_locale�
get_global)�LocaleDataDict)�Literal�
LC_NUMERICc @ s e Zd ZdZd dd�ZdS )
�UnknownCurrencyErrorzRException thrown when a currency is requested for which no data is available.
�
identifier�str�return�Nonec C s t �| d|�d�� || _dS )zkCreate the exception.
:param identifier: the identifier string of the unsupported currency
zUnknown currency �.N)� Exception�__init__r )�selfr � r �F/home/arjun/projects/env/lib/python3.10/site-packages/babel/numbers.pyr ) s
zUnknownCurrencyError.__init__N)r r r r )�__name__�
__module__�__qualname__�__doc__r r r r r r
% s r
�locale�Locale | str | Noner �set[str]c C s | r
t t�| �j�S t td��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.
�all_currencies)�setr �parse�
currenciesr �r r r r �list_currencies3 s r$ �currencyr 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
�r% r r r r �validate_currencyC s �r'