관리-도구
편집 파일: topological.cpython-38.pyc
U -?�f� � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ dd l mZ ddlmZ eded�ZdddgZdddd�dd�Zd(ddddd�dd�Zddd d�d!d�Zd"d#d$�d%d&�Zd'S ))zTopological sorting algorithms.� )�annotations)�Any)� Collection)�DefaultDict)�Iterable)�Iterator)�Sequence)�Set)�Tuple)�TypeVar� )�util)�CircularDependencyError�_T)�bound�sort�sort_as_subsets�find_cycleszCollection[Tuple[_T, _T]]zCollection[_T]zIterator[Sequence[_T]])�tuples�allitems�returnc # s� t �t�}| D ]\}}|| �|� qt|�}t|�� � r�g }|D ]}� �|| �rB|�|� qB|sztdt| |�t |���� � |� � fdd�|D �}|V q6d S )NzCircular dependency detected.c s g | ]}|� kr|�qS � r )�.0�t�Ztodo_setr �K/opt/hc_python/lib64/python3.8/site-packages/sqlalchemy/util/topological.py� <listcomp>6 s z#sort_as_subsets.<locals>.<listcomp>)r �defaultdict�set�add�list� isdisjoint�appendr r � _gen_edges�difference_update)r r �edges�parent�child�todo�output�noder r r r s&