选择文件�文件大�最�修改时间�作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
a ´ie%ã@s@ddgZdZdZGdd„dƒZGdd„deƒZGdd„dƒZdS) ÚTopologicalSorterÚ CycleErroréÿÿÿÿéþÿÿÿc@seZdZdZdd„ZdS)Ú _NodeInfo©ÚnodeÚ npredecessorsÚ successorscCs||_d|_g|_dS©Nér)Úselfr©r ú /usr/lib64/python3.9/graphlib.pyÚ__init__ sz_NodeInfo.__init__N)Ú__name__Ú __module__Ú __qualname__Ú __slots__rr r r rrsrc@seZdZdZdS)raCSubclass 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. N)rrrÚ__doc__r r r rrs c@sbeZdZdZddd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z dd„Z dS)rzFProvides functionality to topologically sort a graph of hashable nodesNcCsHi|_d|_d|_d|_|durD| ¡D]\}}|j|g|¢RŽq(dSr )Ú _node2infoÚ _ready_nodesÚ _npassedoutÚ _nfinishedÚitemsÚadd)r ZgraphrÚ predecessorsr r rr*szTopologicalSorter.__init__cCs*|j |¡}dur&t|ƒ|j|<}|S©N)rÚgetr)r rÚresultr r rÚ _get_nodeinfo4szTopologicalSorter._get_nodeinfocGsR|jdurtdƒ‚| |¡}|jt|ƒ7_|D]}| |¡}|j |¡q2dS)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". Nz/Nodes cannot be added after a call to prepare())rÚ ValueErrorrrÚlenr Úappend)r rrÚnodeinfoZpredZ pred_infor r rr9s   zTopologicalSorter.addcCsB|jdurtdƒ‚dd„|j ¡Dƒ|_| ¡}|r>td|ƒ‚dS)axMark the graph as finished and check for cycles in the graph. If any cycle is detected, "CycleError" will be raised, but "get_ready" can still be used to obtain as many nodes as possible until cycles block more progress. After a call to this function, the graph cannot be modified and therefore no more nodes can be added using "add". Nzcannot prepare() more than oncecSsg|]}|jdkr|j‘qS)r )rr)Ú.0Úir r rÚ _sz-TopologicalSorter.prepare..znodes are in a cycle)rr rÚvaluesÚ _find_cycler)r Úcycler r rÚprepareTs ÿzTopologicalSorter.preparecCsV|jdurtdƒ‚t|jƒ}|j}|D]}t||_q&|j ¡|jt|ƒ7_|S)a©Return a tuple of all the nodes that are ready. Initially it returns all nodes with no predecessors; once those are marked as processed by calling "done", further calls will return all new nodes that have all their predecessors already processed. Once no more progress can be made, empty tuples are returned. Raises ValueError if called without calling "prepare" previously. Núprepare() must be called first) rr ÚtuplerÚ _NODE_OUTrÚclearrr!)r rÚn2irr r rÚ get_readyjs    zTopologicalSorter.get_readycCs(|jdurtdƒ‚|j|jkp&t|jƒS)a¯Return ``True`` if more progress can be made and ``False`` otherwise. Progress can be made if cycles do not block the resolution and either there are still nodes ready that haven't yet been returned by "get_ready" or the number of nodes marked "done" is less than the number that have been returned by "get_ready". Raises ValueError if called without calling "prepare" previously. Nr+)rr rrÚbool©r r r rÚ is_active„s zTopologicalSorter.is_activecCs| ¡Sr)r3r2r r rÚ__bool__’szTopologicalSorter.__bool__cGsÖ|jdurtdƒ‚|j}|D]´}| |¡}durBtd|›d�ƒ‚|j}|tkr„|dkrjtd|›d�ƒ‚n|tkr„td|›d�ƒ‚nt|_|jD]0}||}|jd8_|jdkr�|j |¡q�|j d7_ qdS) aÿMarks a set of nodes returned by "get_ready" as processed. This method unblocks any successor of each node in *nodes* for being returned in the future by a call to "get_ready". Raises :exec:`ValueError` if any node in *nodes* has already been marked as processed by a previous call to this method, if a node was not added to the graph by using "add" or if called without calling "prepare" previously or if node has not yet been returned by "get_ready". Nr+znode z was not added using add()r z% was not passed out (still not ready)z was already marked doneé) rr rrrr-Ú _NODE_DONEr r"r)r Znodesr/rr#ÚstatÚ successorZsuccessor_infor r rÚdone•s*  ÿ  zTopologicalSorter.donec CsÔ|j}g}g}tƒ}i}|D]²}||vr*q||vrV||vrŒ|||d…|gSn6| |¡| t||jƒj¡t|ƒ||<| |¡|rÎz|dƒ}Wq*WqŒtyÆ||  ¡=|  ¡YqŒ0qŒqq*qdS)Nr) rÚsetrr"Úiterr Ú__next__r!Ú StopIterationÚpop)r r/ÚstackZitstackÚseenZ node2stackirr r rr(Äs0      zTopologicalSorter._find_cycleccs2| ¡| ¡r.| ¡}|EdH|j|ŽqdS)aQReturns an iterable of nodes in a topological order. The particular order that is returned may depend on the specific order in which the items were inserted in the graph. Using this method does not require to call "prepare" or "done". If any cycle is detected, :exc:`CycleError` will be raised. N)r*r3r0r9)r Z node_groupr r rÚ static_orderés  zTopologicalSorter.static_order)N)rrrrrrrr*r0r3r4r9r(rAr r r rr's /%N)Ú__all__r-r6rr rrr r r rÚs