| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /Python315/Lib/__pycache__/ |
Upload File : |
R
>lqj�1 c �b � ] QH Gs QQ,sPsQs Q Q2 s Q Q\2 s Q Q2 sP! ) � )�GenericAlias�TopologicalSorter�
CycleErrorc �, ` � \ sQ s] s n QsQ sQsU sP! )� _NodeInfoc �0 � Vm ] U m , U m P! )r ��node�
npredecessors�
successors)�selfr s &&�C:\Python315\\Lib\graphlib.py�__init__�_NodeInfo.__init__ s � �� �
��� ��� r )�__name__�
__module__�__qualname__�__firstlineno__� __slots__r �__static_attributes__�__classdictcell__��
__classdict__s @r
r r s �� � �5�I�� r r c � � \ sQ s]sQsQsP! )r a# Subclass of ValueError raised by TopologicalSorter.prepare if cycles
exist in the working graph.
If multiple cycles exist, only one undefined choice among them will be reported
and included in the exception. The detected cycle can be accessed via the second
element in the *args* attribute of the exception instance and consists in a list
of nodes, such that each node is, in the graph, an immediate predecessor of the
next node in the list. In the reported list, the first and the last node will be
the same, to make it clear that it is cyclic.
� )r r r r �__doc__r r r r
r r s � � � r c �v ` � \ sQ s])s n QsQ
Q ksQ sQ sQ sQ s Q s
Q sQ sQ
s
Q s\ \2 sQsU sP! )r zFProvides functionality to topologically sort a graph of hashable nodesc � � - U m PU m ] U m ] U m Ud2 UO 2 F D v q#U O
U,UN3 J P! P! �N)�
_node2info�_ready_nodes�_npassedout�
_nfinished�items�add)r �graphr �predecessorss && r
r �TopologicalSorter.__init__, sO � ���� �����������&+�k�k�m�"������-��-� '4� r c �z � U O O U2 9oe [ U2 9U O U$ oU! r )r �getr )r r �results && r
�
_get_nodeinfo�TopologicalSorter._get_nodeinfo6 s8 � ��o�o�)�)�$�/�/�F�8�-6�t�_�<�D�O�O�D�!�F��
r c � � U O d [ Q2 gU O U2 oU9O [ U2 *
tm SF D/ oU O U2 oUO
O
U2 J1 P! )a; Add a new node and its predecessors to the graph.
Both the *node* and all elements in *predecessors* must be hashable.
If called multiple times with the same node argument, the set of dependencies
will be the union of all dependencies passed in.
It is possible to add a node with no dependencies (*predecessors* is not provided)
as well as provide a dependency twice. If a node that has not been provided before
is included among *predecessors* it will be automatically added to the graph with
no predecessors of its own.
Raises ValueError if called after "prepare".
z/Nodes cannot be added after a call to prepare())r! �
ValueErrorr, r
�lenr �append)r r r'