$23 GRAYBYTE WORDPRESS FILE MANAGER $47

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/lib64/python3.7/site-packages/pyrsistent/__pycache__/

HOME
Current File : /opt/alt/python37/lib64/python3.7/site-packages/pyrsistent/__pycache__//_pdeque.cpython-37.pyc
B

+�[�/�@srddlmZmZddlmZmZddlmZddlm	Z	Gdd�de
�Ze�e�e�e�dd
d�Z
dd
�Zd	S)�)�Sequence�Hashable�)�islice�chain)�Integral)�plistcs(eZdZdZdZd=�fdd�	Zedd��Zedd	��Ze	d
d��Z
dd
�Zdd�ZeZ
edd��Zd>dd�Zd?dd�Ze	dd��Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Ze	d)d*��Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Z e Z!d7d8�Z"d9d:�Z#d;d<�Z$e%j&Z&�Z'S)@�PDequea�
    Persistent double ended queue (deque). Allows quick appends and pops in both ends. Implemented
    using two persistent lists.

    A maximum length can be specified to create a bounded queue.

    Fully supports the Sequence and Hashable protocols including indexing and slicing but
    if you need fast random access go for the PVector instead.

    Do not instantiate directly, instead use the factory functions :py:func:`dq` or :py:func:`pdeque` to
    create an instance.

    Some examples:

    >>> x = pdeque([1, 2, 3])
    >>> x.left
    1
    >>> x.right
    3
    >>> x[0] == x.left
    True
    >>> x[-1] == x.right
    True
    >>> x.pop()
    pdeque([1, 2])
    >>> x.pop() == x[:-1]
    True
    >>> x.popleft()
    pdeque([2, 3])
    >>> x.append(4)
    pdeque([1, 2, 3, 4])
    >>> x.appendleft(4)
    pdeque([4, 1, 2, 3])

    >>> y = pdeque([1, 2, 3], maxlen=3)
    >>> y.append(4)
    pdeque([2, 3, 4], maxlen=3)
    >>> y.appendleft(4)
    pdeque([4, 1, 2], maxlen=3)
    )�
_left_list�_right_list�_length�_maxlen�__weakref__NcsVtt|��|�}||_||_||_|dk	rLt|t�s<td��|dkrLt	d��||_
|S)Nz An integer is required as maxlenrzmaxlen must be non-negative)�superr	�__new__r
rr�
isinstancer�	TypeError�
ValueErrorr
)�clsZ	left_listZ
right_list�length�maxlen�instance)�	__class__��E/opt/alt/python37/lib64/python3.7/site-packages/pyrsistent/_pdeque.pyr2s
zPDeque.__new__cCst�|j|j�S)z.
        Rightmost element in dqueue.
        )r	�_tip_from_listsrr
)�selfrrr�rightBszPDeque.rightcCst�|j|j�S)z-
        Leftmost element in dqueue.
        )r	rr
r)rrrr�leftIszPDeque.leftcCs"|r
|jS|r|dStd��dS)N���zNo elements in empty deque)�first�
IndexError)�primary_list�secondary_listrrrrPs
zPDeque._tip_from_listscCst|j|j���S)N)rr
r�reverse)rrrr�__iter__ZszPDeque.__iter__cCs&d�t|�|jdk	r d�|j�nd�S)Nzpdeque({0}{1})z, maxlen={0}�)�format�listr
)rrrr�__repr__]s
zPDeque.__repr__cCs|jS)z.
        Maximum length of the queue.
        )r
)rrrrrbsz
PDeque.maxlenrcCsF|dkr|�|�St�|j|j|�\}}t||t|j|d�|j�S)a�
        Return new deque with rightmost element removed. Popping the empty queue
        will return the empty queue. A optional count can be given to indicate the
        number of elements to pop. Popping with a negative index is the same as
        popleft. Executes in amortized O(k) where k is the number of elements to pop.

        >>> pdeque([1, 2]).pop()
        pdeque([1])
        >>> pdeque([1, 2]).pop(2)
        pdeque([])
        >>> pdeque([1, 2]).pop(-1)
        pdeque([2])
        r)�popleftr	�
_pop_listsrr
�maxrr
)r�count�new_right_list�
new_left_listrrr�popisz
PDeque.popcCsF|dkr|�|�St�|j|j|�\}}t||t|j|d�|j�S)z�
        Return new deque with leftmost element removed. Otherwise functionally
        equivalent to pop().

        >>> pdeque([1, 2]).popleft()
        pdeque([2])
        r)r0r	r+r
rr,rr
)rr-r/r.rrrr*}szPDeque.popleftcCs`|}|}xN|dkrV|s|rV|d8}|jr0|j}q
|rD|��}t�}q
|��j}t�}q
W||fS)Nrr)�restr$r)r"r#r-�new_primary_list�new_secondary_listrrrr+�s

zPDeque._pop_listscCs|jo|jS)N)r
r)rrrr�	_is_empty�szPDeque._is_emptycCst|t�stSt|�t|�kS)N)rr	�NotImplemented�tuple)r�otherrrr�__lt__�s
z
PDeque.__lt__cCs:t|t�stSt|�t|�kr6t|�t|�ks2t�dSdS)NTF)rr	r5r6�len�AssertionError)rr7rrr�__eq__�s
z
PDeque.__eq__cCstt|��S)N)�hashr6)rrrr�__hash__�szPDeque.__hash__cCs|jS)N)r)rrrr�__len__�szPDeque.__len__cCs(|�|j|j|�\}}}t||||j�S)z�
        Return new deque with elem as the rightmost element.

        >>> pdeque([1, 2]).append(3)
        pdeque([1, 2, 3])
        )�_appendr
rr	r
)r�elemr/r.�
new_lengthrrr�append�sz
PDeque.appendcCs(|�|j|j|�\}}}t||||j�S)z�
        Return new deque with elem as the leftmost element.

        >>> pdeque([1, 2]).appendleft(3)
        pdeque([3, 1, 2])
        )r?rr
r	r
)rr@r.r/rArrr�
appendleft�szPDeque.appendleftcCsd|jdk	rN|j|jkrN|jdkr*||dfSt�||d�\}}||�|�|jfS||�|�|jdfS)Nrr)r
rr	r+�cons)rr"r#r@r2r3rrrr?�s

zPDeque._appendcCs,d}x|D]}|�|�}|d7}q
W||fS)Nrr)rD)Zthe_list�iterabler-r@rrr�_extend_list�s


zPDeque._extend_listc	Cs`t�||�\}}|}|j|}|jdk	rV||jkrV||j}t�|||�\}}||8}|||fS)N)r	rFrr
r+)	rr"r#rEr2�extend_countr3Zcurrent_lenZpop_lenrrr�_extend�s

zPDeque._extendcCs.|�|j|j|�\}}}t|||j||j�S)z�
        Return new deque with all elements of iterable appended to the right.

        >>> pdeque([1, 2]).extend([3, 4])
        pdeque([1, 2, 3, 4])
        )rHrr
r	rr
)rrEr.r/rGrrr�extend�sz
PDeque.extendcCs.|�|j|j|�\}}}t|||j||j�S)a
        Return new deque with all elements of iterable appended to the left.

        NB! The elements will be inserted in reverse order compared to the order in the iterable.

        >>> pdeque([1, 2]).extendleft([3, 4])
        pdeque([4, 3, 1, 2])
        )rHr
rr	rr
)rrEr/r.rGrrr�
extendleft�s	zPDeque.extendleftcCs|j�|�|j�|�S)z�
        Return the number of elements equal to elem present in the queue

        >>> pdeque([1, 2, 1]).count(1)
        2
        )r
r-r)rr@rrrr-�szPDeque.countcCs~yt|j�|�|j|jd�Stk
rxy$t|j|j���|���|jd�Stk
rrtd�|���YnXYnXdS)z�
        Return new deque with first element from left equal to elem removed. If no such element is found
        a ValueError is raised.

        >>> pdeque([2, 1, 2]).remove(2)
        pdeque([1, 2])
        rz{0} not found in PDequeN)r	r
�removerrrr$r')rr@rrrrKsz
PDeque.removecCst|j|j|j�S)z�
        Return reversed deque.

        >>> pdeque([1, 2, 3]).reverse()
        pdeque([3, 2, 1])

        Also supports the standard python reverse function.

        >>> reversed(pdeque([1, 2, 3]))
        pdeque([3, 2, 1])
        )r	rr
r)rrrrr$szPDeque.reversecCs8|�|�}|dkr&|�t|��|��S|�t||��S)z�
        Return deque with elements rotated steps steps.

        >>> x = pdeque([1, 2, 3])
        >>> x.rotate(1)
        pdeque([3, 1, 2])
        >>> x.rotate(-2)
        pdeque([3, 1, 2])
        r)r0rJrr$rI)rZstepsZpopped_dequerrr�rotate)s

z
PDeque.rotatecCstt|�|jffS)N)�pdequer(r
)rrrr�
__reduce__9szPDeque.__reduce__cCs�t|t�rz|jdk	r4|jdkr4tt|�||jd�S|}|jdk	rT|�|j|j�}|j	dk	rv|�
|j|j	|j�}|St|t�s�tdt
|�j��|dkr�|�|�jSt|�|}|dkr�td�|t|����|�|�jS)Nr)rz-'%s' object cannot be interpreted as an indexrz!pdeque index {0} out of range {1})r�slice�steprMr6r
�startr*r�stopr0rr�type�__name__rr9r!r')r�index�resultZshiftedrrr�__getitem__=s$



zPDeque.__getitem__)N)r)r)(rT�
__module__�__qualname__�__doc__�	__slots__r�propertyrr�staticmethodrr%r)�__str__rr0r*r+r4r8r;r=r>rBrCr?rFrHrIrJr-rKr$�__reversed__rLrNrWrrU�
__classcell__rr)rrr	sB(




		
	
r	rNcCsdt|�}|dk	r||d�}t|�}t|d�}t|d|��}t||d�dd�}t||||�S)a*
    Return deque containing the elements of iterable. If maxlen is specified then
    len(iterable) - maxlen elements are discarded from the left to if len(iterable) > maxlen.

    >>> pdeque([1, 2, 3])
    pdeque([1, 2, 3])
    >>> pdeque([1, 2, 3, 4], maxlen=2)
    pdeque([3, 4], maxlen=2)
    N�T)r$)r6r9�intrr	)rEr�tr�pivotrrrrrrM^s
rMcGst|�S)z[
    Return deque containing all arguments.

    >>> dq(1, 2, 3)
    pdeque([1, 2, 3])
    )rM)�elementsrrr�dqqsrf)rN)�_compatrr�	itertoolsrr�numbersrZpyrsistent._plistr�objectr	�registerrMrfrrrr�<module>sU





Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 11.10 PM
root / root
0755
__init__.cpython-37.opt-1.pyc
1.584 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
__init__.cpython-37.pyc
1.584 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_checked_types.cpython-37.opt-1.pyc
21.088 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_checked_types.cpython-37.pyc
21.088 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_compat.cpython-37.opt-1.pyc
0.635 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_compat.cpython-37.pyc
0.635 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_field_common.cpython-37.opt-1.pyc
10.419 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_field_common.cpython-37.pyc
10.419 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_helpers.cpython-37.opt-1.pyc
3.272 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_helpers.cpython-37.pyc
3.272 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_immutable.cpython-37.opt-1.pyc
3.737 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_immutable.cpython-37.pyc
3.737 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pbag.cpython-37.opt-1.pyc
6.955 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pbag.cpython-37.pyc
6.955 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pclass.cpython-37.opt-1.pyc
9.522 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pclass.cpython-37.pyc
9.522 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pdeque.cpython-37.opt-1.pyc
10.717 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pdeque.cpython-37.pyc
10.717 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_plist.cpython-37.opt-1.pyc
9.03 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_plist.cpython-37.pyc
9.03 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pmap.cpython-37.opt-1.pyc
14.978 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pmap.cpython-37.pyc
14.978 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_precord.cpython-37.opt-1.pyc
6.67 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_precord.cpython-37.pyc
6.67 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pset.cpython-37.opt-1.pyc
6.753 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pset.cpython-37.pyc
6.753 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pvector.cpython-37.opt-1.pyc
22.262 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_pvector.cpython-37.pyc
22.262 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_toolz.cpython-37.opt-1.pyc
3.532 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_toolz.cpython-37.pyc
3.532 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_transformations.cpython-37.opt-1.pyc
3.808 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
_transformations.cpython-37.pyc
3.808 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
typing.cpython-37.opt-1.pyc
1.962 KB
14 Nov 2023 1.59 PM
root / linksafe
0644
typing.cpython-37.pyc
1.962 KB
14 Nov 2023 1.59 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF