jf/ UdZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z ddlmZddlmZddlmZiZd ed <ejZejejed Zejd ejZd&dZ d'dZ!d(dZ"edd)dZ#d*d+dZ$d,d!Z%Gd"d#Z&Gd$d%e j Z'dS)-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-2023 by the Babel Team. :license: BSD, see LICENSE for more details. ) annotationsN)abc)IteratorMappingMutableMapping) lru_cache)chain)Anydict[str, Any]_cachez locale-dataz%^(con|prn|aux|nul|com[0-9]|lpt[0-9])$namestrreturn str | Nonec|rt|tsdS|}t jt tgD]}||kr|cSdS)zNormalize 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) isinstancerstriplowerr from_iterabler locale_identifiers)r locale_ids p/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/babel/localedata.pynormalize_localer!s z$,,t ::<<    D(&2D2F2F)GHH 9??$$ $ $    %os.PathLike[str] | strcPtj|}tjdkrPt tj|drtd|dtj t|dS)z? Resolve a locale identifier to a `.dat` path on disk. win32rzName z is invalid on Windows.dat) ospathbasenamesysplatform_windows_reserved_name_rematchsplitext ValueErrorjoin_dirname)r s rresolve_locale_filenamer*/s 7  D ! !D |w#<#B#B27CSCSTXCYCYZ[C\#]#]====>>> 7<<T--- 0 00rboolc|rt|tsdS|tvrdStjt |}|rdntt|S)zCheck 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*r+r)r file_founds rr-r-?sl z$,,u v~~t 7 = =>>J ?444(8(>(>#?#??r)maxsize list[str]c\ddtjtDDS)a&Return a list of all locale identifiers for which locale data is available. This data is cached after the first invocation. You can clear the cache by calling `locale_identifiers.cache_clear()`. .. versionadded:: 0.8.1 :return: a list of locale identifiers (strings) c0g|]\}}|dk |dk|S)rroot).0stem extensions r z&locale_identifiers..Zs9    D)   46>> $2>>rc3TK|]#}tj|V$dSN)rr r&)r5filenames r z%locale_identifiers..]s2II  ( # #IIIIIIr)rlistdirr)r4rrrrNs>   JIBJx4H4HIII   rTmerge_inheritedcRtj|}t t |}|s|dks|si}nddlm}|d|}|sG| d}t|dkrdnd |dd}t| }t|}t|d 5}|dkr%|r#t!|t#j |nt#j |}dddn #1swxYwY|t |<|tS#twxYw) afLoad 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 identifier, or one of the locales it inherits from r3r) get_globalparent_exceptions_Nrb)rr r! _cache_lockacquirer get babel.corer@splitlenr(loadcopyr*openmergepicklerelease)r r>datar@parentpartsr;fileobjs rrLrLbs2 7  D ! !Dzz$ v~~_~111111#$788<>o>$ G 4 45555!;w//D  0 0 0 0 0 0 0 0 0 0 0 0 0 0 0  F4L s1CF AE F EF "E#F F&dict1MutableMapping[Any, Any]dict2Mapping[Any, Any]Nonec|D]\}}|||}t|tr|i}t|tr||f}njt|t r.|\}}|}t||||f}n'|}t||n|}|||<dS)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)itemsrHrdictAliastuplerMrO)rVrXkeyval2val1aliasotherss rrOrOs[[]] T  99S>>D$%% <DdE** & $)type__name__rfris r__repr__zAlias.__repr__s&74::&777777rrRMapping[str | int | None, Any]c|}|jD] }||} t|tr||}n/t|tr|\}}||}|S)zResolve 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` )rfrr^resolver_)rirRbaser`rcrds rruz Alias.resolves{9  C9DD dE " " '<<%%DD e $ $ ' ME6==&&D rN)rfrgrrZ)rr)rRrsrrs)rp __module__ __qualname____doc__rjrrrur4rrr^r^sZ     8888rr^cLeZdZdZdddZdd Zdd ZddZddZddZ ddZ dS)LocaleDataDictzUDictionary wrapper that automatically resolves aliases to the actual values. NrR%MutableMapping[str | int | None, Any]rv%Mapping[str | int | None, Any] | Nonec*||_||}||_dSr:)_datarv)rirRrvs rrjzLocaleDataDict.__init__s <D rrintc*t|jSr:)rKrrqs r__len__zLocaleDataDict.__len__s4:rIterator[str | int | None]c*t|jSr:)iterrrqs r__iter__zLocaleDataDict.__iter__sDJrr`str | int | Noner c|j|x}}t|tr||j}t|t rA|\}}||j}t||t|trt||j}||ur ||j|<|SN)rv) rrr^rurvr_rMrOr]r{)rir`origvalrcrds r __getitem__zLocaleDataDict.__getitem__sZ_$s c5 ! ! )++di((C c5 ! ! ME6-- **//11C #v    c4  6 49555C d??!DJsO rvaluerZc||j|<dSr:r)rir`rs r __setitem__zLocaleDataDict.__setitem__s 3rc|j|=dSr:r)rir`s r __delitem__zLocaleDataDict.__delitem__s JsOOOrc\t|j|jSr)r{rrMrvrqs rrMzLocaleDataDict.copys#djoo//di@@@@rr:)rRr|rvr})rr)rr)r`rrr )r`rrr rrZ)r`rrrZ)rr{) rprwrxryrjrrrrrrMr4rrr{r{s             AAAAAArr{)r rrr)r rrr)r rrr+)rr0)T)r rr>r+rr )rVrWrXrYrrZ)(ry __future__rrrPrer" threading collectionsrcollections.abcrrr functoolsr itertoolsr typingr r __annotations__RLockrFr r(dirname__file__r)compileIr$rr*r-rrLrOr^r{r4rrrs!   #""""" ==========io 7<<11= A A&BJ'NPRPTUU     1 1 1 1 @ @ @ @ 4&11111hBB&A&A&A&A&AS'&A&A&A&A&Ar