Your IP : 52.14.234.146


Current Path : /opt/imunify360/venv/lib64/python3.11/site-packages/pyrsistent/__pycache__/
Upload File :
Current File : //opt/imunify360/venv/lib64/python3.11/site-packages/pyrsistent/__pycache__/_pset.cpython-311.pyc

�

O�Dg=���ddlmZmZddlZddlmZGd�de��Zeje��eje��ee����Z	d
d�Z
d	�ZdS)�)�Set�HashableN)�pmapc�Z��eZdZdZdZ�fd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Ze
dd���Zd
�Zd�Zd�Zd�ZGd�de��Zd�Zd�ZejZejZejZejZejZejZejZejZej Z ej!Z!eZ"eZ#eZ$eZ%e Z&e!Z'ej(Z(�xZ)S)�PSeta!
    Persistent set implementation. Built on top of the persistent map. The set supports all operations
    in the Set protocol and is Hashable.

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

    Random access and insert is log32(n) where n is the size of the set.

    Some examples:

    >>> s = pset([1, 2, 3, 1])
    >>> s2 = s.add(4)
    >>> s3 = s2.remove(2)
    >>> s
    pset([1, 2, 3])
    >>> s2
    pset([1, 2, 3, 4])
    >>> s3
    pset([1, 3, 4])
    )�_map�__weakref__c�f��tt|���|��}||_|S�N)�superr�__new__r)�cls�m�self�	__class__s   ��p/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/pyrsistent/_pset.pyr
zPSet.__new__s,����T�3���'�'��,�,����	���c��||jvSr)r�r�elements  r�__contains__zPSet.__contains__#s���$�)�#�#rc�*�t|j��Sr)�iterr�rs r�__iter__z
PSet.__iter__&����D�I���rc�*�t|j��Sr)�lenrrs r�__len__zPSet.__len__)s���4�9�~�~�rc��|sdtt|����zSd�tt|����dd���S)N�pzpset([{0}])����)�str�set�formatrs r�__repr__z
PSet.__repr__,sJ���	(���S��Y�Y���'�'��#�#�C��D�	�	�N�N�1�R�4�$8�9�9�9rc�*�|���Sr)r'rs r�__str__zPSet.__str__2s���}�}���rc�*�t|j��Sr)�hashrrs r�__hash__z
PSet.__hash__5rrc�0�tt|��ffSr)�pset�listrs r�
__reduce__zPSet.__reduce__8s���d�4�j�j�]�"�"r�c�l�tttd�|D����|�����S)Nc3�K�|]}|dfV��	dS)TN�)�.0�ks  r�	<genexpr>z&PSet._from_iterable.<locals>.<genexpr>>s&����4�4�A�q�$�i�4�4�4�4�4�4r��pre_size)rr�dict)r�itr9s   r�_from_iterablezPSet._from_iterable<s4���D��4�4��4�4�4�4�4�x�H�H�H�I�I�Irc�t�|����|�����S)z~
        Return a new PSet with element added

        >>> s1 = s(1, 2)
        >>> s1.add(3)
        pset([1, 2, 3])
        ��evolver�add�
persistentrs  rr@zPSet.add@s,���|�|�~�~�!�!�'�*�*�5�5�7�7�7rc��|���}|D]}|�|���|���S)z�
        Return a new PSet with elements in iterable added

        >>> s1 = s(1, 2)
        >>> s1.update([3, 4, 4])
        pset([1, 2, 3, 4])
        r>)r�iterable�ers    r�updatezPSet.updateJs?��
�L�L�N�N���	�	�G�
�E�E�'�N�N�N�N��|�|�~�~�rc���||jvr9|����|�����St	dt|��z���)z�
        Return a new PSet with element removed. Raises KeyError if element is not present.

        >>> s1 = s(1, 2)
        >>> s1.remove(2)
        pset([1])
        z Element '%s' not present in PSet)rr?�removerA�KeyError�reprrs  rrGzPSet.removeXsS���d�i����<�<�>�>�(�(��1�1�<�<�>�>�>��9�D��M�M�I�J�J�Jrc��||jvr9|����|�����S|S)zc
        Return a new PSet with element removed. Returns itself if element is not present.
        )rr?rGrArs  r�discardzPSet.discardes>���d�i����<�<�>�>�(�(��1�1�<�<�>�>�>��rc�6�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	dS)	�
PSet._Evolver)�_original_pset�
_pmap_evolverc�P�||_|j���|_dSr)rNrr?rO)r�
original_psets  r�__init__zPSet._Evolver.__init__qs'��"/�D��!.�!3�!;�!;�!=�!=�D���rc��d|j|<|S)NT�rOrs  rr@zPSet._Evolver.addus��*.�D��w�'��Krc��|j|=|SrrTrs  rrGzPSet._Evolver.removeys���"�7�+��Krc�4�|j���Sr)rO�is_dirtyrs rrWzPSet._Evolver.is_dirty}s���%�.�.�0�0�0rc��|���s|jSt|j�����Sr)rWrNrrOrArs rrAzPSet._Evolver.persistent�s8���=�=�?�?�
,��+�+���*�5�5�7�7�8�8�8rc�*�t|j��Sr)rrOrs rrzPSet._Evolver.__len__�s���t�)�*�*�*rN)
�__name__�
__module__�__qualname__�	__slots__rRr@rGrWrArr4rr�_EvolverrMnss������7�	�	>�	>�	>�	�	�	�	�	�	�	1�	1�	1�	9�	9�	9�	+�	+�	+�	+�	+rr^c��|Srr4rs r�copyz	PSet.copy�s���rc�6�t�|��S)a!
        Create a new evolver for this pset. For a discussion on evolvers in general see the
        documentation for the pvector evolver.

        Create the evolver and perform various mutating updates to it:

        >>> s1 = s(1, 2, 3)
        >>> e = s1.evolver()
        >>> _ = e.add(4)
        >>> len(e)
        4
        >>> _ = e.remove(1)

        The underlying pset remains the same:

        >>> s1
        pset([1, 2, 3])

        The changes are kept in the evolver. An updated pmap can be created using the
        persistent() function on the evolver.

        >>> s2 = e.persistent()
        >>> s2
        pset([2, 3, 4])

        The new pset will share data with the original pset in the same way that would have
        been done if only using operations on the pset.
        )rr^rs rr?zPSet.evolver�s��:�}�}�T�"�"�"r)r1)*rZr[r\�__doc__r]r
rrrr'r)r,r0�classmethodr<r@rErGrK�objectr^r`r?r�__le__�__lt__�__gt__�__ge__�__eq__�__ne__�__and__�__or__�__sub__�__xor__�issubset�
issuperset�union�intersection�
difference�symmetric_difference�
isdisjoint�
__classcell__)rs@rrrs����������*(�I������
$�$�$�������:�:�:�������#�#�#��J�J�J��[�J�8�8�8����K�K�K����+�+�+�+�+�6�+�+�+�6���#�#�#�F�Z�F�
�Z�F�
�Z�F�
�Z�F�
�Z�F�
�Z�F��k�G�
�Z�F��k�G��k�G��H��J��E��L��J�"����J�J�J�J�Jrrr4r1c�L�|stSt�||���S)z�
    Creates a persistent set from iterable. Optionally takes a sizing parameter equivalent to that
    used for :py:func:`pmap`.

    >>> s1 = pset([1, 2, 3, 2])
    >>> s1
    pset([1, 2, 3])
    r8)�_EMPTY_PSETrr<)rCr9s  rr.r.�s+���������x�(��;�;�;rc� �t|��S)z�
    Create a persistent set.

    Takes an arbitrary number of arguments to insert into the new set.

    >>> s1 = s(1, 2, 3, 2)
    >>> s1
    pset([1, 2, 3])
    )r.)�elementss r�sr{�s����>�>�r)r4r1)�collections.abcrr�sys�pyrsistent._pmaprrdr�registerrxr.r{r4rr�<module>r�s���)�)�)�)�)�)�)�)�
�
�
�
�!�!�!�!�!�!�| �| �| �| �| �6�| �| �| �|
���T�������$�����d�4�4�6�6�l�l��<�<�<�<�
�
�
�
�
r

?>