+
    i                        R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RIH
t
 ^ R	IHt ^ R
IHt ^RIHt ^RIHt ]! R]R7      t. ROtR R ltRR R lltR R ltR R ltR# )zTopological sorting algorithms.)annotations)Any)
Collection)DefaultDict)Iterable)Iterator)Sequence)Set)Tuple)TypeVar)util)CircularDependencyError_T)boundc               $    V ^8  d   QhRRRRRR/# )   tuplesCollection[Tuple[_T, _T]]allitemsCollection[_T]returnzIterator[Sequence[_T]] )formats   "ڄC:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\sqlalchemy\util\topological.py__annotate__r      s$      %1?    c              #    "   \         P                  ! \        4      pV  F  w  r4W$,          P                  V4       K  	  \	        V4      p\        V4      pV'       d   . pV F3  pVP                  W(,          4      '       g   K"  VP                  V4       K5  	  V'       g    \        R \        W4      \        V4      4      hVP                  V4       V U	u. uF  qV9   g   K  V	NK  	  pp	Vx  K  R# u up	i 5i)zCircular dependency detected.N)r   defaultdictsetaddlist
isdisjointappendr   find_cycles
_gen_edgesdifference_update)
r   r   edgesparentchildtodotodo_setoutputnodets
   &&        r   sort_as_subsetsr.      s      '+&6&6s&;E    >D8}H
D""5;//d#  )/F-5!  	""6*14a=41  2s*   AC6!C6C6 4C6C1!C1'C6c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r   r   deterministic_orderboolr   zIterator[_T]r   )r   s   "r   r   r   :   s0      %  	r   c              #  J   "   \        W4       F  pT Rj  xL
  K  	  R#  L
5i)a  sort the given list of items by dependency.

'tuples' is a list of tuples representing a partial ordering.

deterministic_order is no longer used, the order is now always
deterministic given the order of "allitems".    the flag is there
for backwards compatibility with Alembic.

N)r.   )r   r   r0   set_s   &&& r   sortr4   :   s        1 2s   #!#c               $    V ^8  d   QhRRRRRR/# )r   r   zIterable[Tuple[_T, _T]]r   zIterable[_T]r   zSet[_T]r   )r   s   "r   r   r   M   s$     ' '#'/;''r   c                   \         P                  ! \        4      pV  F  w  r4W#,          P                  V4       K  	  \        V4      p\        4       pV F  pV.pVP	                  V4      p	V'       g   K!  VR,          p
W*,           Fi  pWx9   d6   WP                  V4      R pV	P                  V4       VP                  V4       Wy9   g   KF  VP                  V4       V	P                  V4        K  	  VP                  4        K  	  V# )   N)r   r   r   r   
differenceindexr%   updater"   removepop)r   r   r&   r'   r(   nodes_to_testr+   r,   stackr)   topcycs   &&          r   r#   r#   M   s     '+&6&6s&;E%   JMUF ''.e)C

=D 1 34C**3/MM#&<LL&KK% # 		! " Mr   c                    V ^8  d   QhRRRR/# )r   r&   zDefaultDict[_T, Set[_T]]r   zSet[Tuple[_T, _T]]r   )r   s   "r   r   r   w   s      F F. F3E Fr   c                V    V  UUu0 uF  qV,           F  q"V3kK  	  K  	  upp# u uppi )Nr   )r&   leftrights   &  r   r$   r$   w   s(    &+EedtDMMeEEEs   %N)r4   r.   r#   )T)__doc__
__future__r   typingr   r   r   r   r   r   r	   r
   r    r   excr   r   __all__r.   r4   r#   r$   r   r   r   <module>rL      sU    & "           )T
48&'TFr   