관리-도구
편집 파일: structs.cpython-39.opt-1.pyc
a ����J{�_8����������������������@���sH���d�dl�mZ�G�dd��de�ZG�dd��de�ZG�dd��de�Zdd ��Zd S�)����)�collections_abcc�������������������@���sp���e�Zd�ZdZdd��Zdd��Zdd��Zdd ��Zd d��Zdd ��Z dd��Z dd��Zdd��Zdd��Z dd��Zdd��ZdS�)� DirectedGraphz&A graph structure with directed edges.c�����������������C���s���t���|�_i�|�_i�|�_d�S��N)�set� _vertices� _forwards� _backwards��self��r����6/usr/lib/python3.9/site-packages/resolvelib/structs.py�__init__���s����zDirectedGraph.__init__c�����������������C���s ���t�|�j�S�r���)�iterr���r ���r���r���r����__iter__���s����zDirectedGraph.__iter__c�����������������C���s ���t�|�j�S�r���)�lenr���r ���r���r���r����__len__���s����zDirectedGraph.__len__c�����������������C���s ���||�j�v�S�r���)r����r ����keyr���r���r����__contains__���s����zDirectedGraph.__contains__c�����������������C���sB���t���}t|�j�|_dd��|�j���D��|_dd��|�j���D��|_|S�)z$Return a shallow copy of this graph.c�����������������S���s���i�|�]\}}|t�|��qS�r����r�����.0�k�vr���r���r���� <dictcomp>��������z&DirectedGraph.copy.<locals>.<dictcomp>c�����������������S���s���i�|�]\}}|t�|��qS�r���r���r���r���r���r���r������r���)r���r���r���r����itemsr���)r ����otherr���r���r����copy���s ����zDirectedGraph.copyc�����������������C���s:���||�j�v�rtd��|�j��|��t��|�j|<�t��|�j|<�dS�)zAdd a new vertex to the graph.z vertex existsN)r���� ValueError�addr���r���r���r���r���r���r���r ������s ���� zDirectedGraph.addc�����������������C���sT���|�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�tr���r���r���r!���%���s ����zDirectedGraph.removec�����������������C���s���||�j�|�v�o||�j|�v�S�r���)r���r����r ���r#���r$���r���r���r���� connected-���s����zDirectedGraph.connectedc�����������������C���s6���||�j�vrt|��|�j|��|��|�j|��|��dS�)zgConnect two existing vertices. Nothing happens if the vertices are already connected. N)r����KeyErrorr���r ���r���r%���r���r���r����connect0���s���� zDirectedGraph.connectc�����������������c���s,���|�j����D�]\}}|D�]}||fV��qq d�S�r���)r���r���)r ���r#���Zchildrenr$���r���r���r���� iter_edges:���s����zDirectedGraph.iter_edgesc�����������������C���s���t�|�j|��S�r���)r���r���r���r���r���r���� iter_children?���s����zDirectedGraph.iter_childrenc�����������������C���s���t�|�j|��S�r���)r���r���r���r���r���r����iter_parentsB���s����zDirectedGraph.iter_parentsN)�__name__� __module__�__qualname__�__doc__r ���r���r���r���r���r ���r!���r&���r(���r)���r*���r+���r���r���r���r���r������s��� r���c�������������������@���sD���e�Zd�ZdZdd��Zdd��Zdd��ZeZdd ��Zd d��Z dd ��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. c�����������������C���s ���||�_�d�S�r�����_factory)r ����factoryr���r���r���r ���O���s����z_FactoryIterableView.__init__c�����������������C���s���d��t|��jt|������S��Nz{}({}))�format�typer,����listr2���r ���r���r���r����__repr__R���s����z_FactoryIterableView.__repr__c�����������������C���s*���zt�|������W�n�ty$���Y�dS�0�dS�)NFT)�nextr2���� StopIterationr ���r���r���r����__bool__U���s ����z_FactoryIterableView.__bool__c�����������������C���s���|�����S�r���r1���r ���r���r���r���r���^���s����z_FactoryIterableView.__iter__c�����������������C���s���|�����S��z4Provide an candidate iterable for `get_preference()`r1���r ���r���r���r����for_preferencea���s����z#_FactoryIterableView.for_preferencec��������������������s������fdd�}t���|�S�)�5Create a new instance excluding specified candidates.c����������������������s�����fdd������D��S�)Nc�����������������3���s���|�]}|��vr|V��qd�S�r���r����r����c�� candidatesr���r���� <genexpr>i���r���zB_FactoryIterableView.excluding.<locals>.factory.<locals>.<genexpr>r1���r����rB���r ���r���r���r3���h���s����z/_FactoryIterableView.excluding.<locals>.factory)r6���)r ���rB���r3���r���rD���r���� excludinge���s����z_FactoryIterableView.excludingN)r,���r-���r.���r/���r ���r8���r;����__nonzero__r���r=���rE���r���r���r���r���r0���F���s���r0���c�������������������@���sL���e�Zd�ZdZdd��Zdd��Zdd��ZeZdd ��Zd d��Z dd ��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`. c�����������������C���s ���||�_�d�S�r����� _sequence)r ���Zsequencer���r���r���r ���u���s����z_SequenceIterableView.__init__c�����������������C���s���d��t|��j|�j�S�r4���)r5���r6���r,���rI���r ���r���r���r���r8���x���s����z_SequenceIterableView.__repr__c�����������������C���s ���t�|�j�S�r���)�boolrI���r ���r���r���r���r;���{���s����z_SequenceIterableView.__bool__c�����������������C���s ���t�|�j�S�r���)r���rI���r ���r���r���r���r�������s����z_SequenceIterableView.__iter__c�����������������C���s ���t�|�j�S�r���)r���rI���r ���r���r���r���r�������s����z_SequenceIterableView.__len__c�����������������C���s���|�j�S�r<���rH���r ���r���r���r���r=�������s����z$_SequenceIterableView.for_preferencec��������������������s���t�|����fdd�|�jD���S�)r>���c��������������������s���g�|�]}|��vr|�qS�r���r���r?���rA���r���r���� <listcomp>����r���z3_SequenceIterableView.excluding.<locals>.<listcomp>)r6���rI���)r ���rB���r���rA���r���rE�������s����z_SequenceIterableView.excludingN)r,���r-���r.���r/���r ���r8���r;���rF���r���r���r=���rE���r���r���r���r���rG���n���s���rG���c�����������������C���s,���t�|��rt|��S�t|�tj�s$t|��}�t|��S�)zCBuild an iterable view from the value returned by `find_matches()`.)�callabler0���� isinstancer����Sequencer7���rG���)�matchesr���r���r����build_iter_view����s ����rP���N)�compatr����objectr���r0���rG���rP���r���r���r���r����<module>���s���B(!