+
    *:g5                        ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHtH	t	  ! R R]
4      tRR R	 lltRR
 R lltRRR/R R llltRR R lltRRR/R R llltR# )    )annotationsN)Literal)Locale)
LC_NUMERICformat_decimalc                  "    ] tR t^
tR R ltRtR# )UnknownUnitErrorc               $    V ^8  d   QhRRRRRR/# )   unitstrlocaler   returnNone )formats   "-/usr/lib/python3/dist-packages/babel/units.py__annotate__UnknownUnitError.__annotate__   s&     M MS M& MT M    c                	:    \         P                  W R V 24       R# )z is not a known unit in N)
ValueError__init__)selfr   r   s   &&&r   r   UnknownUnitError.__init__   s    DF*B6("KLr   r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__r   r   r   r	   r	   
   s    M Mr   r	   c               (    V ^8  d   QhRRRRRRRR/# )	r   measurement_unitr   length"Literal['short', 'long', 'narrow']r   Locale | str | Noner   
str | Noner   )r   s   "r   r   r      s0     ? ??.?  ? 	?r   c                    \         P                  ! T;'       g    \        4      p\        WR7      pV'       g   \	        WR7      hVP
                  P                  V/ 4      P                  V4      # )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. Defaults to the system numeric locale.
:return: The unit display name, or None.
r   r   r   )r   parser   _find_unit_patternr	   unit_display_namesget)r"   r#   r   r   s   &&& r   get_unit_namer.      sX    4 \\&..J/F.>D$4DD$$((r266v>>r   c               $    V ^8  d   QhRRRRRR/# )r   unit_idr   r   r%   r   r&   r   )r   s   "r   r   r   0   s"       -@ J r   c                    \         P                  ! T;'       g    \        4      pVP                  R,          pW9   d   V # \	        V\
        R7       F  pVP                  V 4      '       g   K  Vu # 	  R# )a  
Expand a unit into a qualified form.

Known units can be found in the CLDR Unit Validity XML file:
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml

>>> _find_unit_pattern("radian", locale="en")
'angle-radian'

Unknown values will return None.

>>> _find_unit_pattern("horse", locale="en")

:param unit_id: the code of a measurement unit.
:return: A key to the `unit_patterns` mapping, or None.
unit_patterns)keyN)r   r*   r   _datasortedlenendswith)r0   r   r2   unit_patterns   &&  r   r+   r+   0   s`    " \\&..J/F$*LL$AM}#6  )) 7 r   numbering_systemlatnc               4    V ^8  d   QhRRRRRRRRR	R
RRRR/# )r   valuestr | float | decimal.Decimalr"   r   r#   r$   r   r&   r   r%   r9   Literal['default'] | strr   r   )r   s   "r   r   r   K   s`     PD PD(PDPD /PD 	PD
  PD /PD 	PDr   c                  \         P                  ! T;'       g    \        4      p\        WR7      pV'       g   \	        WR7      hVP
                  R,          V,          P                  V/ 4      p\        V \        4      '       d   T pRp	M\        WWER7      pVP                  V 4      p	W9   d   Wy,          P                  V4      # \        WVR7      p
T RT
;'       g    T 2# )u  Format a value of a given unit.

Values are formatted according to the locale's usual pluralization rules
and number formats.

>>> format_unit(12, 'length-meter', locale='ro_RO')
u'12 metri'
>>> format_unit(15.5, 'length-mile', locale='fi_FI')
u'15,5 mailia'
>>> format_unit(1200, 'pressure-millimeter-ofhg', locale='nb')
u'1\xa0200 millimeter kvikks\xf8lv'
>>> format_unit(270, 'ton', locale='en')
u'270 tons'
>>> format_unit(1234.5, 'kilogram', locale='ar_EG', numbering_system='default')
u'1٬234٫5 كيلوغرام'

Number formats may be overridden with the ``format`` parameter.

>>> import decimal
>>> format_unit(decimal.Decimal("-42.774"), 'temperature-celsius', 'short', format='#.0', locale='fr')
u'-42,8\u202f\xb0C'

The locale's usual pluralization rules are respected.

>>> format_unit(1, 'length-meter', locale='ro_RO')
u'1 metru'
>>> format_unit(0, 'length-mile', locale='cy')
u'0 mi'
>>> format_unit(1, 'length-mile', locale='cy')
u'1 filltir'
>>> format_unit(3, 'length-mile', locale='cy')
u'3 milltir'

>>> format_unit(15, 'length-horse', locale='fi')
Traceback (most recent call last):
    ...
UnknownUnitError: length-horse is not a known unit in fi

.. versionadded:: 2.2.0

:param value: the value to format. If this is a string, no number formatting will be attempted.
: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 format: An optional format, as accepted by `format_decimal`.
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
                         The special value "default" will use the default numbering system of the locale.
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
r(   r)   r2   one)r9   )r#   r    )r   r*   r   r+   r	   r4   r-   
isinstancer   r   plural_formr   r.   )r<   r"   r#   r   r   r9   q_unitr2   formatted_valuerC   fallback_names   &&&&&$     r   format_unitrG   K   s    x \\&..J/F 0@F$4DDLL1&9==fbIM%(b((/#)00AA ""2&QMa A A1ABCCr   c               (    V ^8  d   QhRRRRRRRR/# )r   numerator_unitr   denominator_unitr   r%   r   r&   r   )r   s   "r   r   r      s6     1c 1c1c1c  1c 	1cr   c                &   \         P                  ! T;'       g    \        4      p\        WR7      p\        WR7      pV'       d	   V'       g   R# VP	                  R^4      R,          pVP	                  R^4      R,          p\        V RV 2VR7      # )a  
Find a predefined compound unit pattern.

Used internally by format_compound_unit.

>>> _find_compound_unit("kilometer", "hour", locale="en")
'speed-kilometer-per-hour'

>>> _find_compound_unit("mile", "gallon", locale="en")
'consumption-mile-per-gallon'

If no predefined compound pattern can be found, `None` is returned.

>>> _find_compound_unit("gallon", "mile", locale="en")

>>> _find_compound_unit("horse", "purple", locale="en")

:param numerator_unit: The numerator unit's identifier
:param denominator_unit: The denominator unit's identifier
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
:return: A key to the `unit_patterns` mapping, or None.
:rtype: str|None
r(   N-z-per-)r   r*   r   r+   split)rI   rJ   r   resolved_numerator_unitresolved_denominator_unitbare_numerator_unitbare_denominator_units   &&&    r   _find_compound_unitrS      s    8 \\&..J/F 1O 23C S $(A
 277Q?C5;;CCBG !4 5U;P:QR[abbr   c               <    V ^8  d   QhRRRRRRRRRRR	RR
RRRRR/	# )r   numerator_valuer=   rI   r&   denominator_valuerJ   r#   r$   r   r   r%   r9   r>   r   r   )r   s   "r   r   r      sx     BJ BJ2BJBJ 5BJ !	BJ
 /BJ BJ  BJ /BJ BJr   c          	        \         P                  ! T;'       g    \        4      pV'       d6   V'       d.   V^8X  d'   \        WVR7      pV'       d   \	        V VVVVVR7      # \        V \        4      '       d   T p	M)V'       d   \	        V VVVVVR7      p	M\        V VVVR7      p	\        V\        4      '       d   Tp
MV'       d   V^8X  dj   \        W6R7      pVP                  R,          P                  V/ 4      P                  V/ 4      P                  R4      pV'       d   VP                  V	4      # Rp\	        TT;'       g    RVVVVR7      P                  4       p
M\        VVVVR7      p
VP                  R,          P                  R/ 4      P                  V/ 4      P                  R	R
4      pVP                  W4      # )uA	  
Format a compound number value, i.e. "kilometers per hour" or similar.

Both unit specifiers are optional to allow for formatting of arbitrary values still according
to the locale's general "per" formatting specifier.

>>> format_compound_unit(7, denominator_value=11, length="short", locale="pt")
'7/11'

>>> format_compound_unit(150, "kilometer", denominator_unit="hour", locale="sv")
'150 kilometer per timme'

>>> format_compound_unit(150, "kilowatt", denominator_unit="year", locale="fi")
'150 kilowattia / vuosi'

>>> format_compound_unit(32.5, "ton", 15, denominator_unit="hour", locale="en")
'32.5 tons per 15 hours'

>>> format_compound_unit(1234.5, "ton", 15, denominator_unit="hour", locale="ar_EG", numbering_system="arab")
'1٬234٫5 طن لكل 15 ساعة'

>>> format_compound_unit(160, denominator_unit="square-meter", locale="fr")
'160 par m\xe8tre carr\xe9'

>>> format_compound_unit(4, "meter", "ratakisko", length="short", locale="fi")
'4 m/ratakisko'

>>> format_compound_unit(35, "minute", denominator_unit="nautical-mile", locale="sv")
'35 minuter per nautisk mil'

>>> from babel.numbers import format_currency
>>> format_compound_unit(format_currency(35, "JPY", locale="de"), denominator_unit="liter", locale="de")
'35\xa0\xa5 pro Liter'

See https://www.unicode.org/reports/tr35/tr35-general.html#perUnitPatterns

:param numerator_value: The numerator value. This may be a string,
                        in which case it is considered preformatted and the unit is ignored.
:param numerator_unit: The numerator unit. See `format_unit`.
:param denominator_value: The denominator value. This may be a string,
                          in which case it is considered preformatted and the unit is ignored.
:param denominator_unit: The denominator unit. See `format_unit`.
:param length: The formatting length. "short", "long" or "narrow"
:param format: An optional format, as accepted by `format_decimal`.
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
                         The special value "default" will use the default numbering system of the locale.
:return: A formatted compound value.
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
r(   )r#   r   r   r9   )r   r   r9   r2   per )r"   r#   r   r   r9   compound_unit_patternscompoundz{0}/{1})r   r*   r   rS   rG   rB   r   r   r+   r4   r-   r   strip)rU   rI   rV   rJ   r#   r   r   r9   compound_unitformatted_numeratorformatted_denominatorper_patterns   &&&&&&&$    r   format_compound_unitra      s   z \\&..J/F */@A/E+NU[\!1  /3''-	)-
 --	
 #S)) 1	!12BR ,,7;;<LbQUUV\^`aeefklK"))*=>> !# +.44"-!
 %' 	 !/-	!
 ,,78<<UBGKKFTVW[[\fhqrK1IIr   )longN)N)rb   NN)N   Nrb   NN)
__future__r   decimaltypingr   
babel.corer   babel.numbersr   r   r   r	   r.   r+   rG   rS   ra   r   r   r   <module>ri      si    "    4Mz M
?B6PD 28PD PDf1chBJ 28BJ BJr   