Ë
    u™ãj›  ã                  ó  — d Z ddlmZ ddlmZ ddlZddlZddlZddlZddl	Z	ddl
mZmZ ddlmZ erddlmZ eej"                  f	 	 	 	 	 dd„«       Zej"                  fdd	„Zdd
„Zg d¢Zej,                  dd„«       Z	 	 d	 	 	 	 	 dd„Zy)zx
Helpers for configuring locale settings.

Name `localization` is chosen to avoid overlap with builtin `locale` module.
é    )Úannotations)ÚcontextmanagerN)ÚTYPE_CHECKINGÚcast)Úoptions)Ú	Generatorc              #  ó  K  — t        j                  |«      }	 t        j                  || «       t        j                  «       \  }}|�|�
|› d|› �–— n| –— t        j                  ||«       y# t        j                  ||«       w xY w­w)aE  
    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        úf/var/www/html/python-recuperauto-other/env/lib/python3.12/site-packages/pandas/_config/localization.pyÚ
set_localer      s‡   è ø€ ô. ×%Ñ% fÓ-€Nð1Ü×Ñ˜ Ô,Ü/5×/?Ñ/?Ó/AÑ,ˆÐ,ØÐ&Ð+>Ð+JØ$Ð% QÐ':Ð&;Ð<Ó<àÒä×Ñ˜ Õ0øŒ×Ñ˜ Õ0üs   ‚B
™?A/ ÁB
Á/BÂB
c                óŠ   — 	 t        | |¬«      5  	 ddd«       y# 1 sw Y   yxY w# t        t        j                  f$ r Y yw xY w)aj  
    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   >   sJ   € ð"Ü˜ 6Ô*ñ 	Ø÷	ð ÷	ð ûô	 œŸ™Ð%ò áðús#   ‚& �‘& š#Ÿ& £& ¦AÁAc                óV   ‡— ˆfd„| D «       D �cg c]  }t        |«      r|‘Œ c}S c c}w )ar  
    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  óˆ   •K  — | ]9  }‰r#t        j                  |j                  «       «      n|j                  «       –— Œ; y ­w)N)r   Ú	normalizeÚstrip)Ú.0Úlocr   s     €r   ú	<genexpr>z!_valid_locales.<locals>.<genexpr>l   s7   øè ø€ ò 
àñ .7ŒF×Ñ˜SŸY™Y›[Ô)¸C¿I¹I»KÓGñ
ùs   ƒ?A)r   )Úlocalesr   r   s    ` r   Ú_valid_localesr"   Y   s7   ø€ ó&
àô
öàô ˜#Ôò 	òð ùò s   �&)zde-DE.UTF-8zel-GR.UTF-8zen-US.UTF-8zja-JP.UTF-8ztr-TR.UTF-8c           
     ól  — t        j                  «       dv rot        j                  ddg«      }g }|j	                  d«      D ]A  }	 |j                  t        |t        dt        j                  j                  «      ¬«      «       ŒC n!t        j                  «       dk(  r	t        }d	}ny
| €t        t        ||«      «      S t        j                   | › d�«      }|j#                  dj%                  |«      «      }t        t        ||«      «      S # t        $ r |j                  t        |d¬«      «       Y Œñw xY w)N)ÚLinuxÚDarwinr   z-aó   
Ústr)Úencodingzwindows-1252ÚWindowsF© z.*ú
)ÚplatformÚsystemÚ
subprocessÚcheck_outputÚsplitÚappendr'   r   r   Údisplayr(   ÚUnicodeErrorÚ_WINDOWS_LOCALESÚtupler"   ÚreÚcompileÚfindallÚjoin)Úprefixr   Úraw_localesÚout_localesÚ
raw_localeÚpatternÚfounds          r   Ú_get_localesr@      s  € ä‡�ÓÐ/Ñ/Ü ×-Ñ-¨x¸Ð.>Ó?ˆð ˆØ%×+Ñ+¨EÓ2ò 	MˆJð
MØ×"Ñ"Ü˜
¬T°%¼¿¹×9QÑ9QÓ-RÔSõñ	Mô 
�‰Ó	˜iÒ	'ä&ˆð ‰	àà€~Ü”^ K°Ó;Ó<Ð<ä�j‰j˜F˜8 2˜Ó'€GØ�O‰O˜DŸI™I kÓ2Ó3€EÜ”  yÓ1Ó2Ð2øô+  ò Mð ×"Ñ"¤3 z¸NÔ#KÖLðMús   Á>DÄ%D3Ä2D3c                ó,   — t        t        | |«      «      S )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)

    )Úlistr@   )r:   r   s     r   Úget_localesrC   ¤   s   € ô> ”˜V YÓ/Ó0Ð0ó    )r   zstr | tuple[str, str]r   ÚintÚreturnz Generator[str | tuple[str, str]])r   r'   r   rE   rF   Úbool)r!   zlist[str] | strr   rG   rF   ú	list[str])r:   ú
str | Noner   rG   rF   ztuple[str, ...])NT)r:   rI   r   rG   rF   rH   )Ú__doc__Ú
__future__r   Ú
contextlibr   Ú	functoolsr   r,   r6   r.   Útypingr   r   Úpandas._config.configr   Úcollections.abcr   ÚLC_ALLr   r   r"   r4   Úcacher@   rC   r*   rD   r   ú<module>rS      sÀ   ðñõ #å %Û Û Û Û 	Û ÷õ
 *áÝ)ð à5;·]±]ð 1Ø%ð 1Ø/2ð 1à%ò 1ó ð 1ðF +1¯-©-ô ó6ò:Ð ð ‡�ò!3ó ð!3ðJ Øð1Øð1àð1ð ô1rD   