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: //usr/local/lib/python3.7/site-packages/pip/_vendor/resolvelib/__pycache__/structs.cpython-37.pyc
B

L��gc�@sbddlZddlmZGdd�de�ZGdd�dej�ZGdd	�d	e�ZGd
d�de�Zdd
�Z	dS)�N�)�collections_abcc@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�
DirectedGraphz&A graph structure with directed edges.cCst�|_i|_i|_dS)N)�set�	_vertices�	_forwards�
_backwards)�self�r
�B/tmp/pip-unpacked-wheel-hv55ucu3/pip/_vendor/resolvelib/structs.py�__init__	szDirectedGraph.__init__cCs
t|j�S)N)�iterr)r	r
r
r�__iter__szDirectedGraph.__iter__cCs
t|j�S)N)�lenr)r	r
r
r�__len__szDirectedGraph.__len__cCs
||jkS)N)r)r	�keyr
r
r�__contains__szDirectedGraph.__contains__cCsBt�}t|j�|_dd�|j��D�|_dd�|j��D�|_|S)z$Return a shallow copy of this graph.cSsi|]\}}t|�|�qSr
)r)�.0�k�vr
r
r�
<dictcomp>sz&DirectedGraph.copy.<locals>.<dictcomp>cSsi|]\}}t|�|�qSr
)r)rrrr
r
rrs)rrrr�itemsr)r	�otherr
r
r�copys
zDirectedGraph.copycCs:||jkrtd��|j�|�t�|j|<t�|j|<dS)zAdd a new vertex to the graph.z
vertex existsN)r�
ValueError�addrrr)r	rr
r
rrs

zDirectedGraph.addcCs\|j�|�x$|j�|�D]}|j|�|�qWx$|j�|�D]}|j|�|�q@WdS)zCRemove a vertex from the graph, disconnecting all edges from/to it.N)r�remover�popr)r	r�f�tr
r
rr's
zDirectedGraph.removecCs||j|ko||j|kS)N)rr)r	rrr
r
r�	connected/szDirectedGraph.connectedcCs6||jkrt|��|j|�|�|j|�|�dS)zgConnect two existing vertices.

        Nothing happens if the vertices are already connected.
        N)r�KeyErrorrrr)r	rrr
r
r�connect2s
zDirectedGraph.connectccs4x.|j��D] \}}x|D]}||fVqWqWdS)N)rr)r	r�childrenrr
r
r�
iter_edges<s
zDirectedGraph.iter_edgescCst|j|�S)N)r
r)r	rr
r
r�
iter_childrenAszDirectedGraph.iter_childrencCst|j|�S)N)r
r)r	rr
r
r�iter_parentsDszDirectedGraph.iter_parentsN)�__name__�
__module__�__qualname__�__doc__rrrrrrrr r"r$r%r&r
r
r
rrs
rc@sJeZdZddd�Zdd�Zdd�ZeZdd	�Zd
d�Zdd
�Z	dd�Z
dS)�IteratorMappingNcCs||_||_|pi|_dS)N)�_mapping�	_accessor�_appends)r	�mapping�accessorZappendsr
r
rrIszIteratorMapping.__init__cCsd�|j|j|j�S)Nz!IteratorMapping({!r}, {!r}, {!r}))�formatr,r-r.)r	r
r
r�__repr__NszIteratorMapping.__repr__cCst|jp|j�S)N)�boolr,r.)r	r
r
r�__bool__UszIteratorMapping.__bool__cCs||jkp||jkS)N)r,r.)r	rr
r
rrZszIteratorMapping.__contains__cCsJy|j|}Wntk
r,t|j|�SXt�|�|�|j�|d��S)Nr
)r,r!r
r.�	itertools�chainr-�get)r	rrr
r
r�__getitem__]s
zIteratorMapping.__getitem__cs"�fdd��jD�}t��j|�S)Nc3s|]}|�jkr|VqdS)N)r,)rr)r	r
r�	<genexpr>esz+IteratorMapping.__iter__.<locals>.<genexpr>)r.r5r6r,)r	�morer
)r	rrdszIteratorMapping.__iter__cs&t�fdd��jD��}t�j�|S)Nc3s|]}|�jkrdVqdS)rN)r,)rr)r	r
rr9isz*IteratorMapping.__len__.<locals>.<genexpr>)�sumr.rr,)r	r:r
)r	rrhszIteratorMapping.__len__)N)r'r(r)rr2r4�__nonzero__rr8rrr
r
r
rr+Hs
r+c@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�_FactoryIterableViewa:Wrap an iterator factory returned by `find_matches()`.

    Calling `iter()` on this class would invoke the underlying iterator
    factory, making it a "collection with ordering" that can be iterated
    through multiple times, but lacks random access methods presented in
    built-in Python sequence types.
    cCs||_d|_dS)N)�_factory�	_iterable)r	�factoryr
r
rrvsz_FactoryIterableView.__init__cCsd�t|�jt|��S)Nz{}({}))r1�typer'�list)r	r
r
rr2zsz_FactoryIterableView.__repr__cCs*ytt|��Wntk
r$dSXdS)NFT)�nextr
�
StopIteration)r	r
r
rr4}s
z_FactoryIterableView.__bool__cCs,|jdkr|��n|j}t�|�\|_}|S)N)r?r>r5�tee)r	�iterable�currentr
r
rr�sz_FactoryIterableView.__iter__N)	r'r(r)r*rr2r4r<rr
r
r
rr=msr=c@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�_SequenceIterableViewz�Wrap an iterable returned by find_matches().

    This is essentially just a proxy to the underlying sequence that provides
    the same interface as `_FactoryIterableView`.
    cCs
||_dS)N)�	_sequence)r	�sequencer
r
rr�sz_SequenceIterableView.__init__cCsd�t|�j|j�S)Nz{}({}))r1rAr'rI)r	r
r
rr2�sz_SequenceIterableView.__repr__cCs
t|j�S)N)r3rI)r	r
r
rr4�sz_SequenceIterableView.__bool__cCs
t|j�S)N)r
rI)r	r
r
rr�sz_SequenceIterableView.__iter__N)	r'r(r)r*rr2r4r<rr
r
r
rrH�srHcCs,t|�rt|�St|tj�s$t|�}t|�S)zCBuild an iterable view from the value returned by `find_matches()`.)�callabler=�
isinstancer�SequencerBrH)�matchesr
r
r�build_iter_view�s
rO)
r5�compatr�objectr�Mappingr+r=rHrOr
r
r
r�<module>sB%!