ó
    Ð]jZ  ã                  óø   • S r SSKJr  SSKJr  SSKrSSKrSSKrSSKrSSK	J
r
Jr  SSKJr  \
(       a  SSKJr  \\R                   4     SS jj5       r\R                   4SS	 jjrSS
 jr  S     SS jjrg)zx
Helpers for configuring locale settings.

Name `localization` is chosen to avoid overlap with builtin `locale` module.
é    )Úannotations)ÚcontextmanagerN)ÚTYPE_CHECKINGÚcast)Úoptions)Ú	Generatorc              #  ó  #   • [         R                  " U5      n [         R                  " X5        [         R                  " 5       u  p4Ub  Ub
  U SU 3v •  OU v •  [         R                  " X5        g! [         R                  " X5        f = f7f)a	  
Context manager for temporarily setting a locale.

Parameters
----------
new_locale : str or tuple
    A string of the form <language_country>.<encoding>. For example to set
    the current locale to US English with a UTF8 encoding, you would pass
    "en_US.UTF-8".
lc_var : int, default `locale.LC_ALL`
    The category of the locale being set.

Notes
-----
This is useful when you want to run a particular block of code under a
particular locale, without globally setting the locale. This probably isn't
thread-safe.
NÚ.)ÚlocaleÚ	setlocaleÚ	getlocale)Ú
new_localeÚlc_varÚcurrent_localeÚnormalized_codeÚnormalized_encodings        ÚX/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pandas/_config/localization.pyÚ
set_localer      s}   é € ô. ×%Ò% fÓ-€Nð1Ü×Ò˜Ô,Ü/5×/?Ò/?Ó/AÑ,ˆØÑ&Ð+>Ñ+JØ$Ð% QÐ':Ð&;Ð<Ó<àÒä×Ò˜Õ0øŒ×Ò˜Õ0üs   ‚BšAA2 ÁBÁ2B
Â
Bc                óŽ   •  [        XS9    SSS5        g! , (       d  f       g= f! [        [        R                  4 a     gf = f)a6  
Check to see if we can set a locale, and subsequently get the locale,
without raising an Exception.

Parameters
----------
lc : str
    The locale to attempt to set.
lc_var : int, default `locale.LC_ALL`
    The category of the locale being set.

Returns
-------
bool
    Whether the passed locale can be set
)r   NTF)r   Ú
ValueErrorr   ÚError)Úlcr   s     r   Úcan_set_localer   =   sF   € ð"Ü˜Ó*Ø÷ +ð ÷ +Ô*ð ûô	 œŸ™Ð%ó áðús#   ‚	' ‹�' –
$ ' ¤' §AÁAc                ól   ^• U4S jU  5        Vs/ s H  n[        U5      (       d  M  UPM     sn$ s  snf )a>  
Return a list of normalized locales that do not throw an ``Exception``
when set.

Parameters
----------
locales : str
    A string where each locale is separated by a newline.
normalize : bool
    Whether to call ``locale.normalize`` on each locale.

Returns
-------
valid_locales : list
    A list of valid locales.
c              3  óš   >#   • U  H@  nT(       a$  [         R                  " UR                  5       5      OUR                  5       v •  MB     g 7f)N)r   Ú	normalizeÚstrip)Ú.0Úlocr   s     €r   Ú	<genexpr>Ú!_valid_locales.<locals>.<genexpr>k   s6   øé € ð 
â�ö .7ŒF×Ò˜SŸY™Y›[Ô)¸C¿I¹I»KÔGÚùs   ƒAA)r   )Úlocalesr   r   s    ` r   Ú_valid_localesr#   X   s@   ø€ ô&
áô
óò
ˆCô ˜#×÷ 	ñ
ñð ùò s   �1¨1c           
     ó>  • [         R                  " 5       S;   a  [        R                  " SS/5      nO/ $  UR	                  S5      n/ nU HC  n UR                  [        U[        [        [        R                  R                  5      S95        ME     U c  [        WU5      $ [        R                  " U  S35      nUR!                  SR#                  W5      5      n[        Xq5      $ ! [         a    UR                  [        USS95         MÀ  f = f! [         a     N‰f = f)	aÝ  
Get all the locales that are available on the system.

Parameters
----------
prefix : str
    If not ``None`` then return only those locales with the prefix
    provided. For example to get all English language locales (those that
    start with ``"en"``), pass ``prefix="en"``.
normalize : bool
    Call ``locale.normalize`` on the resulting list of available locales.
    If ``True``, only locales that can be set without throwing an
    ``Exception`` are returned.

Returns
-------
locales : list of strings
    A list of locale strings that can be set with ``locale.setlocale()``.
    For example::

        locale.setlocale(locale.LC_ALL, locale_string)

On error will return an empty list (no locale available, e.g. Windows)

)ÚLinuxÚDarwinr   z-aó   
)Úencodingzwindows-1252z.*Ú
)ÚplatformÚsystemÚ
subprocessÚcheck_outputÚsplitÚappendÚstrr   r   Údisplayr(   ÚUnicodeErrorÚ	TypeErrorr#   ÚreÚcompileÚfindallÚjoin)Úprefixr   Úraw_localesÚsplit_raw_localesÚout_localesÚxÚpatternÚfounds           r   Úget_localesr?   s   s
  € ô: ‡‚ÓÐ/Ó/Ü ×-Ò-¨x¸Ð.>Ó?‰ð ˆ	ðð (×-Ñ-¨eÓ4ÐØˆÛ"ˆAðDØ×"Ñ"¤3 q´4¼¼W¿_¹_×=UÑ=UÓ3VÑ#WÖXñ #ð �~Ü˜k¨9Ó5Ð5ä�jŠj˜F˜8 2˜Ó'€GØ�O‰O˜DŸI™I kÓ2Ó3€EÜ˜%Ó+Ð+øô!  ó Dð ×"Ñ"¤3 q°>Ñ#B×CðDûô ó Ùðús5   ¶D Á?C%ÂD Ã%#DÄD ÄDÄD Ä
DÄD)r   zstr | tuple[str, str]r   ÚintÚreturnz Generator[str | tuple[str, str]])r   r0   r   r@   rA   Úbool)r"   zlist[str] | strr   rB   rA   ú	list[str])NT)r8   z
str | Noner   rB   rA   rC   )Ú__doc__Ú
__future__r   Ú
contextlibr   r   r*   r4   r,   Útypingr   r   Úpandas._config.configr   Úcollections.abcr   ÚLC_ALLr   r   r#   r?   © ó    r   Ú<module>rM      sœ   ðñõ #å %Û Û Û 	Û ÷õ
 *æÝ)ð à5;·]±]ð 1Ø%ð 1Ø/2ð 1à%ô 1ó ð 1ðF +1¯-©-ö ô6ð8 Øð=,Øð=,àð=,ð ö=,rL   