
    MhF                        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
  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)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        M/var/www/html/env/lib/python3.13/site-packages/pandas/_config/localization.py
set_localer      s}     . %%f-N1,/5/?/?/A,&+>+J$%Q':&;<<00s   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   9   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>g   s6      
 .7FSYY[)CIIKGs   AA)r   )localesr   r   s    ` r   _valid_localesr"   T   s@    &


C # 	
  s   11c           	     "   [         R                  " 5       S;   a  [        R                  " SS/5      nO/ $  UR	                  S5      n/ nU H5  n UR                  [        U[        R                  R                  S95        M7     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     Nf = 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   displayr'   UnicodeError	TypeErrorr"   recompilefindalljoin)prefixr   raw_localessplit_raw_localesout_localesxpatternfounds           r   get_localesr>   o   s   : // --x.>? 	 (--e4"AD""3q7??3K3K#LM # ~k955jjF82'GOODIIk23E%++!   D ""3q>#BCD  s5   D 1C D #C>:D =C>>D 
DD)r   zstr | tuple[str, str]r   intreturnz,Generator[str | tuple[str, str], None, None])r   r/   r   r?   r@   bool)r!   zlist[str] | strr   rA   r@   	list[str])NT)r7   z
str | Noner   rA   r@   rB   )__doc__
__future__r   
contextlibr   r
   r)   r3   r+   typingr   pandas._config.configr   collections.abcr   LC_ALLr   r   r"   r>        r   <module>rL      s   
 # %   	    )) 5;]] 1% 1/2 11 1  1F +1-- 68 =,=,=, =,rK   