/opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util
Edit: /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/topological.pyo (2466B)
ó
ÃÌ4]c @ sc d Z d d l m Z d d l m Z d d d g Z e d „ Z e d „ Z d „ Z d
„ Z
d S( s Topological sorting algorithms.i ( t util( t CircularDependencyErrort sortt sort_as_subsetst find_cyclesc
c sâ t j t ƒ } x% | D] \ } } | | j | ƒ q W| rF t j n t } | | ƒ } xƒ | rÝ | ƒ } x1 | D]) } | j | | ƒ rq | j | ƒ qq qq W| sÈ t d t | | ƒ t | ƒ ƒ ‚ n | j | ƒ | Vq[ Wd S( Ns Circular dependency detected.(
R t defaultdictt sett addt
OrderedSett
isdisjointR R t
_gen_edgest difference_update(
t tuplest allitemst deterministic_ordert edgest parentt childt Sett todot outputt node( ( sN /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/topological.pyR s"
c c s7 x0 t | | | ƒ D] } x | D] } | Vq Wq Wd S( sÁ sort the given list of items by dependency.
'tuples' is a list of tuples representing a partial ordering.
'deterministic_order' keeps items within a dependency tier in list order.
N( R ( R R
R t set_t s( ( sN /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/topological.pyR , s
c C s t j t ƒ } x% | D] \ } } | | j | ƒ q Wt | ƒ } t ƒ } xÄ | D]¼ } | g } | j | ƒ } x› | r| d }
x„ | |
D]l } | | k rÑ | | j | ƒ } | j | ƒ | j | ƒ n | | k r | j | ƒ | j | ƒ Pq q W| j
ƒ } qt WqS W| S( Niÿÿÿÿ( R R R R t
differencet indexR t updatet appendt removet pop( R R
R R R t
nodes_to_testR R t stackR t topt cyc( ( sN /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/topological.pyR 8 s*
c C s4 t g | D]# } | | D] } | | f ^ q q
ƒ S( N( R ( R t leftt right( ( sN /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/topological.pyR
` s N( t __doc__t R t excR t __all__t FalseR R R R
( ( ( sN /opt/alt/python27/lib64/python2.7/site-packages/sqlalchemy/util/topological.pyt
s (