%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3.9/site-packages/resolvelib/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3.9/site-packages/resolvelib/__pycache__/structs.cpython-39.opt-1.pyc

a

J{�_8�@sHddlmZGdd�de�ZGdd�de�ZGdd�de�Zdd	�Zd
S)�)�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�6/usr/lib/python3.9/site-packages/resolvelib/structs.py�__init__szDirectedGraph.__init__cCs
t|j�Sr)�iterrr	rrr�__iter__szDirectedGraph.__iter__cCs
t|j�Sr)�lenrr	rrr�__len__szDirectedGraph.__len__cCs
||jvSr)r�r
�keyrrr�__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�vrrr�
<dictcomp>�z&DirectedGraph.copy.<locals>.<dictcomp>cSsi|]\}}|t|��qSrrrrrrrr)rrrr�itemsr)r
�otherrrr�copys
zDirectedGraph.copycCs:||jvrtd��|j�|�t�|j|<t�|j|<dS)zAdd a new vertex to the graph.z
vertex existsN)r�
ValueError�addrrrrrrrr s

zDirectedGraph.addcCsT|j�|�|j�|�D]}|j|�|�q|j�|�D]}|j|�|�q:dS)zCRemove a vertex from the graph, disconnecting all edges from/to it.N)r�remover�popr)r
r�f�trrrr!%s
zDirectedGraph.removecCs||j|vo||j|vSr)rr�r
r#r$rrr�	connected-szDirectedGraph.connectedcCs6||jvrt|��|j|�|�|j|�|�dS)zgConnect two existing vertices.

        Nothing happens if the vertices are already connected.
        N)r�KeyErrorrr rr%rrr�connect0s
zDirectedGraph.connectccs,|j��D]\}}|D]}||fVqq
dSr)rr)r
r#Zchildrenr$rrr�
iter_edges:szDirectedGraph.iter_edgescCst|j|�Sr)rrrrrr�
iter_children?szDirectedGraph.iter_childrencCst|j|�Sr)rrrrrr�iter_parentsBszDirectedGraph.iter_parentsN)�__name__�
__module__�__qualname__�__doc__r
rrrrr r!r&r(r)r*r+rrrrrs
rc@sDeZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
d�Z	dd
�Z
dS)�_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
||_dSr��_factory)r
�factoryrrrr
Osz_FactoryIterableView.__init__cCsd�t|�jt|����S�Nz{}({}))�format�typer,�listr2r	rrr�__repr__Rsz_FactoryIterableView.__repr__cCs*zt|���Wnty$YdS0dS)NFT)�nextr2�
StopIterationr	rrr�__bool__Us
z_FactoryIterableView.__bool__cCs|��Srr1r	rrrr^sz_FactoryIterableView.__iter__cCs|��S�z4Provide an candidate iterable for `get_preference()`r1r	rrr�for_preferenceasz#_FactoryIterableView.for_preferencecs��fdd�}t��|�S)�5Create a new instance excluding specified candidates.cs�fdd����D�S)Nc3s|]}|�vr|VqdSrr�r�c��
candidatesrr�	<genexpr>irzB_FactoryIterableView.excluding.<locals>.factory.<locals>.<genexpr>r1r�rBr
rrr3hsz/_FactoryIterableView.excluding.<locals>.factory)r6)r
rBr3rrDr�	excludingesz_FactoryIterableView.excludingN)r,r-r.r/r
r8r;�__nonzero__rr=rErrrrr0Fsr0c@sLeZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
d�Z	dd
�Z
dd�ZdS)�_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
||_dSr��	_sequence)r
Zsequencerrrr
usz_SequenceIterableView.__init__cCsd�t|�j|j�Sr4)r5r6r,rIr	rrrr8xsz_SequenceIterableView.__repr__cCs
t|j�Sr)�boolrIr	rrrr;{sz_SequenceIterableView.__bool__cCs
t|j�Sr)rrIr	rrrr�sz_SequenceIterableView.__iter__cCs
t|j�Sr)rrIr	rrrr�sz_SequenceIterableView.__len__cCs|jSr<rHr	rrrr=�sz$_SequenceIterableView.for_preferencecst|��fdd�|jD��S)r>csg|]}|�vr|�qSrrr?rArr�
<listcomp>�rz3_SequenceIterableView.excluding.<locals>.<listcomp>)r6rI)r
rBrrArrE�sz_SequenceIterableView.excludingN)r,r-r.r/r
r8r;rFrrr=rErrrrrGnsrGcCs,t|�rt|�St|tj�s$t|�}t|�S)zCBuild an iterable view from the value returned by `find_matches()`.)�callabler0�
isinstancer�Sequencer7rG)�matchesrrr�build_iter_view�s
rPN)�compatr�objectrr0rGrPrrrr�<module>sB(!

Zerion Mini Shell 1.0