Your IP : 3.142.36.215
�
Q�Dgh. � � � d dl mZ d dlZd dlmZ d dlmZ d dlmZm Z erd dl
mZ G d� de� � Z
d efd d�Zefd!d�Zd defd"d�Zefd#d�Zdddd defd$d�ZdS )%� )�annotationsN)�
TYPE_CHECKING)�Locale)�
LC_NUMERIC�format_decimal)�Literalc � � e Zd Zd d�ZdS )
�UnknownUnitError�unit�str�localer �return�Nonec �F � t � | |� d|� �� � d S )Nz is not a known unit in )�
ValueError�__init__)�selfr r
s �k/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/babel/units.pyr zUnknownUnitError.__init__ s, � ����D�T�"K�"K�6�"K�"K�L�L�L�L�L� N)r r r
r r r )�__name__�
__module__�__qualname__r � r r r
r
s. � � � � � �M� M� M� M� M� Mr r
�long�measurement_unitr �length�"Literal['short', 'long', 'narrow']r
�Locale | str | Noner �
str | Nonec �� � t j |� � }t | |�� � }|st | |�� � �|j � |i � � � |� � S )a�
Get the display name for a measurement unit in the given locale.
>>> get_unit_name("radian", locale="en")
'radians'
Unknown units will raise exceptions:
>>> get_unit_name("battery", locale="fi")
Traceback (most recent call last):
...
UnknownUnitError: battery/long is not a known unit/length in fi
:param measurement_unit: the code of a measurement unit.
Known units can be found in the CLDR Unit Validity XML file:
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
:param length: "short", "long" or "narrow"
:param locale: the `Locale` object or locale identifier
:return: The unit display name, or None.
�r
�r r
)r �parse�_find_unit_patternr
�unit_display_names�get)r r r
r s r �
get_unit_namer'