File: //opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/__pycache__/util.cpython-37.pyc
B
��4][r � @ sf d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm
Z
dd lmZ dd
lm
Z
ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddlm"Z" ddlm#Z# ddlm$Z$ ddlm%Z% dd lm&Z& e&j'�(e!j)d!�Z*d"d#� Z+d$d%� Z,d&d'� Z-d(d)� Z.dUd+d,�Z/d-d.� Z0d/d0� Z1d1d2� Z2d3d4� Z3d5d6� Z4d7d8� Z5dVd:d;�Z6d<d=� Z7d>d?� Z8d@dA� Z9G dBdC� dCe:�Z;G dDdE� dEe;�Z<G dFdG� dGe;�Z=dHdI� Z>dWdKdL�Z?dMdN� Z@dXdOdP�ZAG dQdR� dRejB�ZCG dSdT� dTeC�ZDdJS )Yz;High level utilities which build upon other modules here.
� )�deque)�chain� )� operators)�visitors)�_deep_annotate)�_deep_deannotate)�_shallow_annotate)�
_from_objects)� ColumnSet)�sort_tables)�_expand_cloned)�
_find_columns)�_label_reference)�_textual_label_reference)�
BindParameter)�ColumnClause)�
ColumnElement)�Null)�UnaryExpression)�Column)�Alias)�
FromClause)�FromGrouping)�Join)�ScalarSelect)�
SelectBase)�TableClause� )�exc)�utilz.sql.util.join_conditionc C sL t t|��}g }x6t| �D ]*\}}x |D ]}|�|�r(|�|� q(W qW |S )a� Given a list of FROM clauses and a selectable,
return the first index and element from the list of
clauses which can be joined against the selectable. returns
None, None if no match is found.
e.g.::
clause1 = table1.join(table2)
clause2 = table4.join(table5)
join_to = table2.join(table3)
find_join_source([clause1, clause2], join_to) == clause1
)�listr
� enumerate�is_derived_from�append)�clauses�join_to�selectables�idx�i�f�s� r, �F/opt/alt/python37/lib64/python3.7/site-packages/sqlalchemy/sql/util.py�find_join_source1 s
r. c C s� t t|��}g }x8t| �D ],\}}x"|D ]}|�|�r(|�|� P q(W qW t|�dkr�g }xD|D ]<}| | }x.|D ]&}tt|���t|��rr|�|� P qrW q`W |r�|S |S )z�Given a list of FROM clauses and a selectable,
return the indexes from the list of
clauses which is derived from the selectable.
r ) r! r
r"