HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/pip/_vendor/resolvelib/__pycache__/structs.cpython-310.pyc
o

��h�@s^ddlmZddlZddlmZddlmZmZmZm	Z	m
Z
mZmZm
Z
mZmZed�Zed�Zed�Zee	eege	effZerfdd	lmZGd
d�deeeef�ZGdd
�d
eeeeef�Znedddg�Zed
gd��ZGdd�dee�ZGdd�deee
efeeeef�ZGdd�de	e�ZGdd�de	e�Zddd�Ze	ZdS) �)�annotationsN)�
namedtuple)
�
TYPE_CHECKING�Callable�Generic�Iterable�Iterator�Mapping�
NamedTuple�Sequence�TypeVar�Union�KT�RT�CT�)�	Criterionc@seZdZUded<ded<dS)�RequirementInformationr�requirementz	CT | None�parentN)�__name__�
__module__�__qualname__�__annotations__�rr�I/usr/local/lib/python3.10/dist-packages/pip/_vendor/resolvelib/structs.pyrs
rc@s*eZdZUdZded<ded<ded<dS)	�StatezResolution state in a round.zdict[KT, CT]�mappingzdict[KT, Criterion[RT, CT]]�criteriaz$list[RequirementInformation[RT, CT]]�backtrack_causesN)rrr�__doc__rrrrrrs

rrr)rrrc@s�eZdZdZd&dd�Zd'dd�Zd(d
d�Zd)dd�Zd*dd�Zd+dd�Z	d+dd�Z
d,dd�Zd-dd�Zd.dd �Z
d/d!d"�Zd/d#d$�Zd%S)0�
DirectedGraphz&A graph structure with directed edges.�return�NonecCst�|_i|_i|_dS�N)�set�	_vertices�	_forwards�
_backwards��selfrrr�__init__0s
zDirectedGraph.__init__�Iterator[KT]cC�
t|j�Sr$)�iterr&r)rrr�__iter__5�
zDirectedGraph.__iter__�intcCr-r$)�lenr&r)rrr�__len__8r0zDirectedGraph.__len__�keyr�boolcCs
||jvSr$)r&�r*r4rrr�__contains__;r0zDirectedGraph.__contains__�DirectedGraph[KT]cCsFt|��}t|j�|_dd�|j��D�|_dd�|j��D�|_|S)z$Return a shallow copy of this graph.cS�i|]	\}}|t|��qSr�r%��.0�k�vrrr�
<dictcomp>B�z&DirectedGraph.copy.<locals>.<dictcomp>cSr9rr:r;rrrr?Cr@)�typer%r&r'�itemsr()r*�otherrrr�copy>s

zDirectedGraph.copycCs:||jvr	td��|j�|�t�|j|<t�|j|<dS)zAdd a new vertex to the graph.z
vertex existsN)r&�
ValueError�addr%r'r(r6rrrrFFs

zDirectedGraph.addcCsT|j�|�|j�|�D]
}|j|�|�q|j�|�D]
}|j|�|�qdS)zCRemove a vertex from the graph, disconnecting all edges from/to it.N)r&�remover'�popr()r*r4�f�trrrrGNs�zDirectedGraph.removerIrJcCs||j|vo
||j|vSr$)r(r'�r*rIrJrrr�	connectedVszDirectedGraph.connectedcCs6||jvr	t|��|j|�|�|j|�|�dS)zgConnect two existing vertices.

        Nothing happens if the vertices are already connected.
        N)r&�KeyErrorr'rFr(rKrrr�connectYs
zDirectedGraph.connect�Iterator[tuple[KT, KT]]ccs.�|j��D]\}}|D]}||fVqqdSr$)r'rB)r*rI�childrenrJrrr�
iter_edgescs���zDirectedGraph.iter_edgescC�t|j|�Sr$)r.r'r6rrr�
iter_childrenh�zDirectedGraph.iter_childrencCrRr$)r.r(r6rrr�iter_parentskrTzDirectedGraph.iter_parentsN)r"r#�r"r,�r"r1)r4rr"r5)r"r8)r4rr"r#)rIrrJrr"r5)rIrrJrr"r#)r"rO)r4rr"r,)rrrr r+r/r3r7rDrFrGrLrNrQrSrUrrrrr!-s











r!c@sVeZdZ	d!d"d
d�Zd#d
d�Zd$dd�Zd%dd�Zd&dd�Zd'dd�Zd(dd �Z	dS))�IteratorMappingNr�Mapping[KT, RT]�accessor�Callable[[RT], Iterable[CT]]�appends� Mapping[KT, Iterable[CT]] | Noner"r#cCs||_||_|p	i|_dSr$)�_mapping�	_accessor�_appends)r*rrZr\rrrr+pszIteratorMapping.__init__�strcCsd�|j|j|j�S)Nz!IteratorMapping({!r}, {!r}, {!r}))�formatr^r_r`r)rrr�__repr__zs
�zIteratorMapping.__repr__r5cCst|jp|j�Sr$)r5r^r`r)rrr�__bool__�szIteratorMapping.__bool__r4�objectcCs||jvp	||jvSr$)r^r`r6rrrr7�szIteratorMapping.__contains__r=r�Iterator[CT]cCsLz|j|}Wntyt|j|�YSwt�|�|�|j�|d��S)Nr)r^rMr.r`�	itertools�chainr_�get)r*r=r>rrr�__getitem__�s�zIteratorMapping.__getitem__r,cs"�fdd��jD�}t��j|�S)Nc3s�|]
}|�jvr|VqdSr$�r^�r<r=r)rr�	<genexpr>���z+IteratorMapping.__iter__.<locals>.<genexpr>)r`rgrhr^�r*�morerr)rr/�szIteratorMapping.__iter__r1cs&t�fdd��jD��}t�j�|S)Nc3s�|]
}|�jvrdVqdS)rNrkrlr)rrrm�rnz*IteratorMapping.__len__.<locals>.<genexpr>)�sumr`r2r^rorr)rr3�szIteratorMapping.__len__r$)rrYrZr[r\r]r"r#�r"ra�r"r5)r4rer"r5)r=rr"rfrVrW)
rrrr+rcrdr7rjr/r3rrrrrXos�





rXc@s8eZdZdZddd�Zdd	d
�Zddd
�Zddd�ZdS)�_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.
    �factory�Callable[[], Iterable[RT]]r"r#cCs||_d|_dSr$)�_factory�	_iterable)r*rurrrr+�s
z_FactoryIterableView.__init__racCst|�j�dt|��d�S�N�(�))rAr�listr)rrrrc�sz_FactoryIterableView.__repr__r5cCs(z	tt|��WdStyYdSw)NFT)�nextr.�
StopIterationr)rrrrd�s��z_FactoryIterableView.__bool__�Iterator[RT]cCs,|jdur	|��n|j}t�|�\|_}|Sr$)rxrwrg�tee)r*�iterable�currentrrrr/�sz_FactoryIterableView.__iter__N)rurvr"r#rrrs�r"r�rrrr r+rcrdr/rrrrrt�s


rtc@s8eZdZdZddd�Zddd	�Zddd�Zddd�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`.
    �sequence�Sequence[RT]cCs
||_dSr$)�	_sequence)r*r�rrrr+�r0z_SequenceIterableView.__init__r"racCst|�j�d|j�d�Sry)rArr�r)rrrrc�sz_SequenceIterableView.__repr__r5cCr-r$)r5r�r)rrrrd�r0z_SequenceIterableView.__bool__rcCr-r$)r.r�r)rrrr/�r0z_SequenceIterableView.__iter__N)r�r�rrrsr�r�rrrrr��s


r��matches�Matches[CT]r"�Iterable[CT]cCs*t|�rt|�St|t�st|�}t|�S)zCBuild an iterable view from the value returned by `find_matches()`.)�callablert�
isinstancerr|r�)r�rrr�build_iter_view�s

r�)r�r�r"r�)�
__future__rrg�collectionsr�typingrrrrrr	r
rrr
rrr�Matches�resolvers.criterionrrrr!rXrtr�r��IterableViewrrrr�<module>s,0
�(B(