shell bypass 403

Cubjrnet7 Shell


name : localedata.cpython-39.pyc
a

�`��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
iZe��Z
ej�ej�e�d�Ze�dej�Zdd�Zd	d
�Zdd�Zd
d�Zddd�Zdd�ZGdd�de�ZGdd�de
j�ZdS)aG
    babel.localedata
    ~~~~~~~~~~~~~~~~

    Low-level locale data access.

    :note: The `Locale` class, which uses this module under the hood, provides a
           more convenient interface for accessing the locale data.

    :copyright: (c) 2013-2021 by the Babel Team.
    :license: BSD, see LICENSE for more details.
�N)�chain)�pickle�string_types�abczlocale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$cCsL|rt|t�sdS|����}t�tt�g�D]}||��kr.|Sq.dS)z�Normalize a locale ID by stripping spaces and apply proper casing.

    Returns the normalized locale ID string or `None` if the ID is not
    recognized.
    N)�
isinstancer�strip�lowerr�
from_iterable�_cache�locale_identifiers)�nameZ	locale_id�r
�4/usr/lib/python3.9/site-packages/babel/localedata.py�normalize_localesrcCsJtj�|�}tjdkr8t�tj�|�d�r8td|��tj�	t
d|�S)z?
    Resolve a locale identifier to a `.dat` path on disk.
    �win32rzName %s is invalid on Windowsz%s.dat)�os�path�basename�sys�platform�_windows_reserved_name_re�match�splitext�
ValueError�join�_dirname)rr
r
r�resolve_locale_filename,s rcCsB|rt|t�sdS|tvrdStj�t|��}|r6dStt|��S)z�Check whether locale data is available for the given locale.

    Returns `True` if it exists, `False` otherwise.

    :param name: the locale identifier string
    FT)	rrr
rr�existsr�boolr)rZ
file_foundr
r
rr<srcCs<ttdd�}|dur8dd�dd�t�t�D�D�t_}|S)a�Return a list of all locale identifiers for which locale data is
    available.

    This data is cached after the first invocation in `locale_identifiers.cache`.

    Removing the `locale_identifiers.cache` attribute or setting it to `None`
    will cause this function to re-read the list from disk.

    .. versionadded:: 0.8.1

    :return: a list of locale identifiers (strings)
    �cacheNcSs$g|]\}}|dkr|dkr|�qS)z.dat�rootr
)�.0�stem�	extensionr
r
r�
<listcomp>Zs�z&locale_identifiers.<locals>.<listcomp>css|]}tj�|�VqdS�N)rrr)r!�filenamer
r
r�	<genexpr>]�z%locale_identifiers.<locals>.<genexpr>)�getattrrr�listdirrr)�datar
r
rrKs
�rTcCstj�|�}t��z�t�|�}|s�|dks0|s6i}nXddlm}|d��|�}|s�|�	d�}t
|�dkrpd}nd�|dd��}t|��
�}t|�}t|d	��8}|dkr�|r�t|t�|��n
t�|�}Wd�n1s�0Y|t|<|Wt��St��0dS)
aeLoad the locale data for the given locale.

    The locale data is a dictionary that contains much of the data defined by
    the Common Locale Data Repository (CLDR). This data is stored as a
    collection of pickle files inside the ``babel`` package.

    >>> d = load('en_US')
    >>> d['languages']['sv']
    u'Swedish'

    Note that the results are cached, and subsequent requests for the same
    locale return the same dictionary:

    >>> d1 = load('en_US')
    >>> d2 = load('en_US')
    >>> d1 is d2
    True

    :param name: the locale identifier string (or "root")
    :param merge_inherited: whether the inherited data should be merged into
                            the data of the requested locale
    :raise `IOError`: if no locale data file is found for the given locale
                      identifer, or one of the locales it inherits from
    r r)�
get_globalZparent_exceptions�_�N����rb)rrr�_cache_lock�acquirer
�getZ
babel.corer,�split�lenr�load�copyr�open�merger�release)rZmerge_inheritedr+r,�parent�partsr&Zfileobjr
r
rr6cs2

(�r6cCs�|��D]�\}}|dur|�|�}t|t�r�|dur8i}t|t�rL||f}q�t|t�rz|\}}|��}t||�||f}q�|��}t||�n|}|||<qdS)anMerge the data from `dict2` into the `dict1` dictionary, making copies
    of nested dictionaries.

    >>> d = {1: 'foo', 3: 'baz'}
    >>> merge(d, {1: 'Foo', 2: 'Bar'})
    >>> sorted(d.items())
    [(1, 'Foo'), (2, 'Bar'), (3, 'baz')]

    :param dict1: the dictionary to merge into
    :param dict2: the dictionary containing the data that should be merged
    N)�itemsr3r�dict�Alias�tupler7r9)Zdict1Zdict2�keyZval2Zval1�alias�othersr
r
rr9�s"






r9c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r?z�Representation of an alias in the locale data.

    An alias is a value that refers to some other part of the locale data,
    as specified by the `keys`.
    cCst|�|_dSr%)r@�keys)�selfrDr
r
r�__init__�szAlias.__init__cCsdt|�j|jfS)Nz<%s %r>)�type�__name__rD�rEr
r
r�__repr__�szAlias.__repr__cCsN|}|jD]}||}q
t|t�r.|�|�}nt|t�rJ|\}}|�|�}|S)z�Resolve the alias based on the given data.

        This is done recursively, so if one alias resolves to a second alias,
        that second alias will also be resolved.

        :param data: the locale data
        :type data: `dict`
        )rDrr?�resolver@)rEr+�baserArBrCr
r
rrK�s	




z
Alias.resolveN)rH�
__module__�__qualname__�__doc__rFrJrKr
r
r
rr?�sr?c@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�LocaleDataDictzUDictionary wrapper that automatically resolves aliases to the actual
    values.
    NcCs||_|dur|}||_dSr%)�_datarL)rEr+rLr
r
rrF�szLocaleDataDict.__init__cCs
t|j�Sr%)r5rQrIr
r
r�__len__�szLocaleDataDict.__len__cCs
t|j�Sr%)�iterrQrIr
r
r�__iter__�szLocaleDataDict.__iter__cCs�|j|}}t|t�r$|�|j�}t|t�rP|\}}|�|j���}t||�t|�t	urjt
||jd�}||ur|||j|<|S�N)rL)rQrr?rKrLr@r7r9rGr>rP)rErAZorig�valrBrCr
r
r�__getitem__�s



zLocaleDataDict.__getitem__cCs||j|<dSr%�rQ)rErA�valuer
r
r�__setitem__�szLocaleDataDict.__setitem__cCs|j|=dSr%rX)rErAr
r
r�__delitem__�szLocaleDataDict.__delitem__cCst|j��|jd�SrU)rPrQr7rLrIr
r
rr7szLocaleDataDict.copy)N)rHrMrNrOrFrRrTrWrZr[r7r
r
r
rrP�s
rP)T) rOr�rer�	threading�	itertoolsrZ
babel._compatrrrr
�RLockr1rr�dirname�__file__r�compile�Irrrrrr6r9�objectr?�MutableMappingrPr
r
r
r�<module>s$

7!!

© 2025 Cubjrnet7