HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //opt/osm/venv/lib64/python3.10/site-packages/urllib3/__pycache__/_collections.cpython-310.pyc
o

<i�C�@s4ddlmZddlZddlmZddlmZmZddlm	Z	ej
r5ddlmZddlm
Z
Gdd	�d	e�Zd
dgZe�d�Ze�d
�Ze�d�Zejdejeefejeeefd	fZGdd�de�Zddd�ZGdd
�d
ejeefejeef�ZGdd�deeeef�Z Gdd�dejeef�Z!dS)�)�annotationsN)�OrderedDict)�Enum�auto)�RLock)�Protocol)�Selfc@s eZdZd
dd�Zddd�Zd	S)�HasGettableStringKeys�return�typing.Iterator[str]cC�dS�N���selfrr�B/opt/osm/venv/lib/python3.10/site-packages/urllib3/_collections.py�keys�zHasGettableStringKeys.keys�key�strcCrr
r�rrrrr�__getitem__rz!HasGettableStringKeys.__getitem__N�r
r�rrr
r)�__name__�
__module__�__qualname__rrrrrrr	s
r	�RecentlyUsedContainer�HTTPHeaderDict�_KT�_VT�_DTc@seZdZe�ZdS)�	_SentinelN)rrrr�
not_passedrrrrr"'s
r"�	potential�objectr
�ValidHTTPHeaderSource | NonecCszt|t�r|St|tj�rt�tjttf|�St|tj�r+t�tjtttf|�St|d�r;t|d�r;t�d|�SdS)Nrrr	)	�
isinstancer�typing�Mapping�castr�Iterable�tuple�hasattr)r$rrr�%ensure_can_construct_http_header_dict+s
r.cs�eZdZUdZded<ded<ded<ded	<	
	d%d&�fdd�
Zd'dd�Zd(dd�Zd)dd�Zd*dd�Z	d+dd�Z
d,d d!�Zd-d#d$�Z�Z
S).ra�
    Provides a thread-safe dict-like container which maintains up to
    ``maxsize`` keys while throwing away the least-recently-used keys beyond
    ``maxsize``.

    :param maxsize:
        Maximum number of recent elements to retain.

    :param dispose_func:
        Every time an item is evicted from the container,
        ``dispose_func(value)`` is called.  Callback which will get called
    ztyping.OrderedDict[_KT, _VT]�
_container�int�_maxsize�#typing.Callable[[_VT], None] | None�dispose_funcr�lock�
N�maxsizer
�Nonecs*t���||_||_t�|_t�|_dSr
)�super�__init__r1r3rr/rr4)rr6r3��	__class__rrr9Rs

zRecentlyUsedContainer.__init__rrr cCsD|j�|j�|�}||j|<|Wd�S1swYdSr
)r4r/�pop)rr�itemrrrr]s

$�z!RecentlyUsedContainer.__getitem__�valuec	Cs�d}|j�5z||j�|�f}||j|<Wnty2||j|<t|j�|jkr0|jjdd�}YnwWd�n1s=wY|durT|jrV|\}}|�|�dSdSdS)NF)�last)r4r/r<�KeyError�lenr1�popitemr3)rrr>Zevicted_item�_�
evicted_valuerrr�__setitem__ds"
�����z!RecentlyUsedContainer.__setitem__cCsJ|j�|j�|�}Wd�n1swY|jr#|�|�dSdSr
)r4r/r<r3)rrr>rrr�__delitem__}s��z!RecentlyUsedContainer.__delitem__cCs4|j�
t|j�Wd�S1swYdSr
)r4rAr/rrrr�__len__�s$�zRecentlyUsedContainer.__len__�typing.NoReturncCstd��)Nz7Iteration over this class is unlikely to be threadsafe.)�NotImplementedErrorrrrr�__iter__�s�zRecentlyUsedContainer.__iter__cCs`|j�t|j���}|j��Wd�n1swY|jr,|D]	}|�|�q$dSdSr
)r4�listr/�values�clearr3)rrLr>rrrrM�s��zRecentlyUsedContainer.clear�set[_KT]cCs8|j�t|j���Wd�S1swYdSr
)r4�setr/rrrrrr�s$�zRecentlyUsedContainer.keys)r5N)r6r0r3r2r
r7)rrr
r )rrr>r r
r7)rrr
r7�r
r0)r
rH)r
r7)r
rN)rrr�__doc__�__annotations__r9rrErFrGrJrMr�
__classcell__rrr:rr?s 

�






c@sBeZdZUdZded<ddd�Zdd
d�Zdd
d�Zddd�ZdS)�HTTPHeaderDictItemViewa�
    HTTPHeaderDict is unusual for a Mapping[str, str] in that it has two modes of
    address.

    If we directly try to get an item with a particular name, we will get a string
    back that is the concatenated version of all the values:

    >>> d['X-Header-Name']
    'Value1, Value2, Value3'

    However, if we iterate over an HTTPHeaderDict's items, we will optionally combine
    these values based on whether combine=True was called when building up the dictionary

    >>> d = HTTPHeaderDict({"A": "1", "B": "foo"})
    >>> d.add("A", "2", combine=True)
    >>> d.add("B", "bar")
    >>> list(d.items())
    [
        ('A', '1, 2'),
        ('B', 'foo'),
        ('B', 'bar'),
    ]

    This class conforms to the interface required by the MutableMapping ABC while
    also giving us the nonstandard iteration behavior we want; items with duplicate
    keys, ordered by time of first insertion.
    r�_headers�headersr
r7cCs
||_dSr
)rU)rrVrrrr9��
zHTTPHeaderDictItemView.__init__r0cCstt|j����Sr
)rArKrU�	iteritemsrrrrrG�szHTTPHeaderDictItemView.__len__� typing.Iterator[tuple[str, str]]cCs
|j��Sr
)rUrXrrrrrJ�rWzHTTPHeaderDictItemView.__iter__r=r%�boolcCsDt|t�r t|�dkr |\}}t|t�r t|t�r |j�||�SdS)N�F)r'r,rArrU�_has_value_for_header)rr=Z
passed_keyZ
passed_valrrr�__contains__�s
z#HTTPHeaderDictItemView.__contains__N)rVrr
r7rP�r
rY)r=r%r
rZ)	rrrrQrRr9rGrJr]rrrrrT�s



rTcs`eZdZUdZded<dVdW�fd	d
�
ZdXdd�ZdYdd�ZdZdd�Zd[dd�Z	d\d]�fdd�
Z
d^dd�Zd^d d!�Zd_d#d$�Z
d`d&d'�ZdZd(d)�Zd*d+�dad-d.�Zdbd1d2�Zejdcd4d5��Zejddd8d5��Zejfded:d5�Zdfd<d=�ZeZeZeZeZdgd>d?�Zdhd@dA�ZdfdBdC�ZdidEdF�ZdidGdH�Z djdJdK�Z!dkdNdO�Z"dldPdQ�Z#dmdRdS�Z$dmdTdU�Z%�Z&S)nrap
    :param headers:
        An iterable of field-value pairs. Must not contain multiple field names
        when compared case-insensitively.

    :param kwargs:
        Additional field-value pairs to pass in to ``dict.update``.

    A ``dict`` like container for storing HTTP Headers.

    Field names are stored and compared case-insensitively in compliance with
    RFC 7230. Iteration provides the first case-sensitive key seen for each
    case-insensitive pair.

    Using ``__setitem__`` syntax overwrites fields that compare equal
    case-insensitively in order to maintain ``dict``'s api. For fields that
    compare equal, instead create a new ``HTTPHeaderDict`` and use ``.add``
    in a loop.

    If multiple fields that are equal case-insensitively are passed to the
    constructor or ``.update``, the behavior is undefined and some will be
    lost.

    >>> headers = HTTPHeaderDict()
    >>> headers.add('Set-Cookie', 'foo=bar')
    >>> headers.add('set-cookie', 'baz=quxx')
    >>> headers['content-length'] = '7'
    >>> headers['SET-cookie']
    'foo=bar, baz=quxx'
    >>> headers['Content-Length']
    '7'
    z%typing.MutableMapping[str, list[str]]r/NrVr&�kwargsrcsNt���i|_|durt|t�r|�|�n|�|�|r%|�|�dSdSr
)r8r9r/r'r�
_copy_from�extend)rrVr_r:rrr9�s


�zHTTPHeaderDict.__init__r�valr
r7cCs*t|t�r
|�d�}||g|j|��<dS)N�latin-1)r'�bytes�decoder/�lower�rrrbrrrrE�s

zHTTPHeaderDict.__setitem__cCs |j|��}d�|dd��S)N�, ��r/rf�joinrgrrrrszHTTPHeaderDict.__getitem__cCs|j|��=dSr
�r/rfrrrrrFszHTTPHeaderDict.__delitem__r%rZcCst|t�r|��|jvSdS)NF)r'rrfr/rrrrr]s
zHTTPHeaderDict.__contains__��defaultcst��||�Sr
)r8�
setdefault�rrrnr:rrro
szHTTPHeaderDict.setdefault�othercCsDt|�}|dur
dSt|�|�}dd�|��D�dd�|��D�kS)NFcSsi|]	\}}|��|�qSr)rf)�.0�k�vrrr�
<dictcomp>sz)HTTPHeaderDict.__eq__.<locals>.<dictcomp>)r.�type�
itermerged)rrq�maybe_constructableZother_as_http_header_dictrrr�__eq__s�zHTTPHeaderDict.__eq__cCs|�|�Sr
)ry)rrqrrr�__ne__szHTTPHeaderDict.__ne__r0cCs
t|j�Sr
)rAr/rrrrrGrWzHTTPHeaderDict.__len__rccs �|j��D]}|dVqdS)Nr)r/rL)r�valsrrrrJ!s��zHTTPHeaderDict.__iter__cCs"z||=WdStyYdSwr
)r@rrrr�discard&s
�zHTTPHeaderDict.discardF)�combiner}cCsxt|t�r
|�d�}|��}||g}|j�||�}||ur:t|�dks%J�|r3|dd||d<dS|�|�dSdS)a�Adds a (name, value) pair, doesn't overwrite the value if it already
        exists.

        If this is called with combine=True, instead of adding a new header value
        as a distinct item during iteration, this will instead append the value to
        any existing header value with a comma. If no existing header value exists
        for the key, then the value will simply be added, ignoring the combine parameter.

        >>> headers = HTTPHeaderDict(foo='bar')
        >>> headers.add('Foo', 'baz')
        >>> headers['foo']
        'bar, baz'
        >>> list(headers.items())
        [('foo', 'bar'), ('foo', 'baz')]
        >>> headers.add('foo', 'quz', combine=True)
        >>> list(headers.items())
        [('foo', 'bar, baz, quz')]
        rcr[���rhN)r'rdrerfr/rorA�append)rrrbr}�	key_lower�new_valsr{rrr�add,s

�zHTTPHeaderDict.add�args�ValidHTTPHeaderSourcecOs$t|�dkrtdt|��d���t|�dkr|dnd}t|t�r1|��D]
\}}|�||�q%nPt|tj�rG|��D]
\}}|�||�q;n:t|tj	�rht�
tj	tttf|�}|D]
\}}|�||�q\nt
|d�r�t
|d�r�|��D]
}|�|||�qv|��D]
\}}|�||�q�dS)	z�Generic import function for any type of header-like object.
        Adapted version of MutableMapping.update in order to insert items
        with self.add instead of self.__setitem__
        riz/extend() takes at most 1 positional arguments (z given)rrrrN)rA�	TypeErrorr'rrXr�r(r)�itemsr+r*r,rr-r)rr�r_rqrrbr>rrrraOs0�
����zHTTPHeaderDict.extend�	list[str]cCrr
rrrrr�getlistp�zHTTPHeaderDict.getlistr!�list[str] | _DTcCrr
rrprrrr�sr��_Sentinel | _DTcCsHz	|j|��}Wnty|tjurgYS|YSw|dd�S)zmReturns a list of all the values for the named field. Returns an
        empty list if the key doesn't exist.riN)r/rfr@r"r#)rrrnr{rrrr�vs
�	rcCs gd�}|D]}|�|�q|S)z�
        Remove content-specific header fields before changing the request
        method to GET or HEAD according to RFC 9110, Section 15.4.
        )zContent-EncodingzContent-LanguagezContent-LocationzContent-TypezContent-Length�Digestz
Last-Modified)r|)r�content_specific_headers�headerrrr�_prepare_for_method_change�s	z)HTTPHeaderDict._prepare_for_method_changecCst|�j�dt|����d�S)N�(�))rvr�dictrwrrrr�__repr__�szHTTPHeaderDict.__repr__cCs,|D]}|�|�}|g|�|j|��<qdSr
)r�r/rf)rrqrrbrrrr`�s
�zHTTPHeaderDict._copy_fromcCst|��}|�|�|Sr
)rvr`)r�clonerrr�copy�s

zHTTPHeaderDict.copyrYccs>�|D]}|j|��}|dd�D]	}|d|fVqqdS)z8Iterate over all header lines, including duplicate ones.riNrrl)rrr{rbrrrrX�s���zHTTPHeaderDict.iteritemsccs:�|D]}|j|��}|dd�|dd��fVqdS)z:Iterate over all headers, merging duplicate ones together.rrhriNrjrgrrrrw�s
��zHTTPHeaderDict.itermergedrTcCst|�Sr
)rTrrrrr��szHTTPHeaderDict.items�header_name�potential_valuecCs&||vr||j|��dd�vSdS)NriFrl)rr�r�rrrr\�sz$HTTPHeaderDict._has_value_for_headercCs"t|�}|dur
tS|�|�|Sr
)r.�NotImplementedra)rrqrxrrr�__ior__�s

zHTTPHeaderDict.__ior__cCs*t|�}|dur
tS|��}|�|�|Sr
)r.r�r�ra�rrqrx�resultrrr�__or__�s
zHTTPHeaderDict.__or__cCs.t|�}|dur
tSt|�|�}|�|�|Sr
)r.r�rvrar�rrr�__ror__�s
zHTTPHeaderDict.__ror__r
)rVr&r_r)rrrbrr
r7r)rrr
r7)rr%r
rZ)rm)rrrnrr
r)rqr%r
rZrPr)rrrbrr}rZr
r7)r�r�r_rr
r7)rrr
r�)rrrnr!r
r�)rrrnr�r
r�)r
r)r
r)rqrr
r7r^)r
rT)r�rr�rr
rZ)rqr%r
r)rqr%r
r)'rrrrQrRr9rErrFr]roryrzrGrJr|r�rar(�overloadr�r"r#r��
getheaders�getallmatchingheaders�iget�get_allr�r`r�rXrwr�r\r�r�r�rSrrr:rr�sJ
!









#!�









	
)r$r%r
r&)"�
__future__rr(�collectionsr�enumrr�	threadingr�
TYPE_CHECKINGrZtyping_extensionsrr	�__all__�TypeVarrr r!�Unionr)rr+r,r�r"r.�Generic�MutableMappingrrOrTrrrrr�<module>s2


��
&]0