
    f=                     4    g d Z dZ G d de      Zd ZddZy))toposorttoposort_flattenCircularDependencyErrorz1.10c                        e Zd Z fdZ xZS )r   c                     ddj                  d |j                         D               d}t        t        |   |       || _        y )Nz0Circular dependencies exist among these items: {z, c              3   0   K   | ]  \  }}| d |   yw):N ).0keyvalues      \/var/www/teaching_timetable/msuas_timetable/my_venv/lib/python3.12/site-packages/toposort.py	<genexpr>z3CircularDependencyError.__init__.<locals>.<genexpr>*   s%     Iz_i_bdiSEQRSXRYJZIzs   })joinitemssuperr   __init__data)selfr   s	__class__s      r   r   z CircularDependencyError.__init__)   sC    ?		IzmqmwmwmyIz@z?{{}~%t5a8	    )__name__
__module____qualname__r   __classcell__)r   s   @r   r   r   (   s     r   r   c           	   #   r  K   t        |       dk(  ry| j                         D ci c]  \  }t        fd|D               } }}| j                         D ch c]  }|D ]  }|  c}}t        | j	                               z
  }| j                  |D ci c]  }|t                c}       	 t        d | j                         D              }|sn0| | j                         D ci c]  \  }}||vs|||z
   } }}St        |       dk7  rt        |       yc c}}w c c}}w c c}w c c}}w w)a'  Dependencies are expressed as a dictionary whose keys are items
and whose values are a set of dependent items. Output is a list of
sets in topological order. The first set consists of items with no
dependences, each subsequent set consists of items that depend upon
items in the preceeding sets.    Nc              3   .   K   | ]  }|k7  s	|  y w)Nr	   )r
   eitems     r   r   ztoposort.<locals>.<genexpr>=   s     2AT	a2s   
c              3   D   K   | ]  \  }}t        |      d k(  s|  yw)r   N)len)r
   r!   deps      r   r   ztoposort.<locals>.<genexpr>K   s     JytSCHMdJs     )r#   r   setvalueskeysupdater   )r   r!   r$   r&   r   extra_items_in_depsordereds    `     r   r   r   /   s7     4yA~ EIJJLQQytSD#2222QDQ 04{{}QV&Q5Q5QTW		U  	KK)<=su=>
JDJJLJJ37::<
&/dC4wCVD3= 
 
  4yA~%d++ + R R >
s;   $D7D D7D&,-D7D,+AD7-D1:D15D7c                 p    g }t        |       D ]%  }|j                   |rt        nt        |             ' |S )zReturns a single list of dependencies. For any set returned by
toposort(), those items are sorted and appended to the result (just to
make the results deterministic).)r   extendsortedlist)r   sortresultds       r   r   r   V   s9     Fd^ 5/v4345Mr   N)T)__all____version__
ValueErrorr   r   r   r	   r   r   <module>r5      s*   H Fj $,N	r   