HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyc
�
���ec@s�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	l
mZdd
l
mZddl
m
Z
ddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z ddl!m"Z"ddl!m#Z#ddl!m$Z$ddl!m%Z%ddl!m&Z&dd l!m'Z'dd!l!m(Z(dd"l)m*Z*d#d$lm+Z+d#d%lm,Z,e,j-j.e%j/d&�Z0d'�Z1d(�Z2d)�Z3d*�Z4e5e5e5e5e5d+�Z6d,�Z7d-�Z8d.�Z9d/�Z:d0�Z;d1�Z<d2�Z=d3�Z>d4�Z?d5�Z@d6�ZAd7eBfd8��YZCd9�ZDd:eCfd;��YZEd<eCfd=��YZFd>�ZGdId?�ZId@�ZJdIdIe5dA�ZKdBe	jLfdC��YZMdDeMfdE��YZNdIdIdF�ZOdG�ZPdH�ZQdIS(Js;High level utilities which build upon other modules here.

i����(tdeque(tchaini(t	coercions(t	operators(troles(tvisitors(t_deep_annotate(t_deep_deannotate(t_shallow_annotate(t_expand_cloned(t
_from_objects(t	ColumnSet(tsort_tables(t
_find_columns(t_label_reference(t_textual_label_reference(t
BindParameter(tColumnClause(t
ColumnElement(tGrouping(tLabel(tNull(tUnaryExpression(tColumn(tAlias(t
FromClause(tFromGrouping(tJoin(tScalarSelect(t
SelectBase(tTableClause(tHasCacheKeyi(texc(tutils.sql.util.join_conditioncCsitt|��}g}xJt|�D]<\}}x-|D]%}|j|�r8|j|�q8q8Wq%W|S(s�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

    (tlistR
t	enumeratetis_derived_fromtappend(tclausestjoin_totselectablestidxtitfts((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytfind_join_source6s
c	Cs�tt|��}g}xKt|�D]=\}}x.|D]&}|j|�r8|j|�Pq8q8Wq%Wt|�dkr�g}x[|D]S}||}x@|D]8}tt|��jt|��r�|j|�Pq�q�Wq�W|r�|Sn|S(s�Given a list of FROM clauses and a selectable,
    return the indexes from the list of
    clauses which is derived from the selectable.

    i(	R"R
R#R$R%tlentsettsurface_selectablestintersection(	R&t	join_fromR(tliberal_idxR*R+R,tconservative_idxR)((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt#find_left_clause_that_matches_givenPs&





cCs�g}tt|��}t|�dkrK|dk	rKt}t|�}nt}d}x�t|�D]�\}}x�|j|g�D]s}	|r�t|j	�j
|	j	�j|�r�|j|�Pq�q�|dk	s�t
j||	�r�|j|�Pq�q�WqdWt|�dkrjttg|D]}t|j�^q��}
g|D]}|||
krE|^qE}n|r�|dk	r�tt|��S|SdS(sGiven a list of FROM clauses, a selectable,
    and optional ON clause, return a list of integer indexes from the
    clauses list indicating the clauses that can be joined from.

    The presence of an "onclause" indicates that at least one clause can
    definitely be joined from; if the list of clauses is of length one
    and the onclause is given, returns that index.   If the list of clauses
    is more than length one, and the onclause is given, attempts to locate
    which clauses contain the same columns.

    iN(R/R
R.tNonetTrueR
tFalseR#t
differencetctuniont
issupersetR%Rt	_can_joinRR	t_hide_fromstrange(R&R'tonclauseR)R(tresolve_ambiguitytcols_in_onclauseR*R+R,ttoremove((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytfind_left_clause_to_join_fromzs.$

+,cs5g����fd��t�|��d�dS(s�Produce a traversal of the given expression, delivering
    column comparisons to the given function.

    The function is of the form::

        def my_fn(binary, left, right)

    For each binary expression located which has a
    comparison operator, the product of "left" and
    "right" will be delivered to that function,
    in terms of that binary.

    Hence an expression like::

        and_(
            (a + b) == q + func.sum(e + f),
            j == r
        )

    would have the traversal::

        a <eq> q
        a <eq> e
        a <eq> f
        b <eq> q
        b <eq> e
        b <eq> f
        j <eq> r

    That is, every combination of "left" and
    "right" that doesn't further contain
    a binary comparison is passed as pairs.

    c3st|t�r|Vn�|jdkr�tj|j�r��jd|�xE�|j�D]4}x+�|j�D]}��d||�qnWqXW�j	d�xk|j
�D]}�|�q�WnJt|t�r�|Vnx0|j
�D]"}x�|�D]}|Vq�Wq�WdS(Ntbinaryi(t
isinstanceRt__visit_name__Rt
is_comparisontoperatortinserttlefttrighttpoptget_childrenR(telementtltrtelemte(tfntstacktvisit(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyRV�s 
N(R"R6(RTtexpr((RTRURVsD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytvisit_binary_product�s#cs�g�i}|r*�j|d<|d<n|r@�j|d<n|rn�j|d<|d<|d<|d<n|r��fd�|d	<|d
<|d<n|r��fd�}||d
<n�j|d<tj|i|��S(s1locate Table objects within the given expression.tselecttcompound_selecttjointaliastsubqueryttablesampletlateralcs�j|j�S(N(R%ttable(tent(ttables(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt<lambda>tRJtupdatetdeletecs�j|j�dS(N(R%R`(tcolumn(Rb(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytvisit_columnsRgR`(R%Rttraverse(tclauset
check_columnstinclude_aliasest
include_joinstinclude_selectstinclude_crudt	_visitorsRh((RbsD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytfind_tables�s 
(&

cCsYtj�}g}t|g�}x1|rT|j�}t|t�r-t|t�shtj|j	�r-t|t
�r�t|jt�r�|j}t|t
�r�|j}n|j|�q$n+t|t�r�|j}|j|�q$nt|t�rq$n||krQ|j|�|j|�qQq$x!|j�D]}|j|�q:Wq$W|S(sqBreak up an 'order by' expression into individual column-expressions,
    without DESC/ASC/NULLS FIRST/NULLS LAST(R!t
column_setRtpopleftRFRRRtis_ordering_modifiertmodifierRRORRR%RRtaddRN(RjtcolstresultRUttR:((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytunwrap_order_bys6		
	

cCsd�}tj|i|�S(NcSs t|ttf�r|jSdS(N(RFRRRO(RR((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytreplaceGs(Rtreplacement_traverse(ROR{((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytunwrap_label_referenceFs	cCs�tg|D]$}|jdk	r(|jn|^q
�}ttg|D]}t|�^qD��}g|D]}||kri|^qiS(s�Given the columns clause and ORDER BY of a selectable,
    return a list of column expressions that can be added to the collist
    corresponding to the ORDER BY, without repeating those already
    in the collist.

    N(R/t_order_by_label_elementR6ROR"RRz(tcollisttorder_bytcoltcols_already_presenttotto_look_for((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt expand_column_list_from_order_byNs
1+cCs/x(t|�D]}||kr
tSq
WtSdS(s�Given a target clause and a second to search within, return True
    if the target is plainly present in the search without any
    subqueries or aliases involved.

    Basically descends through Joins.

    N(R0R7R8(RjtsearchRR((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytclause_is_presentas	ccs�t|t�rPxt|j�D]}|VqWxUt|j�D]}|Vq>Wn6t|t�r�x$t|j�D]}|VqoWn|VdS(N(RFRttables_from_leftmostRKRLRRO(RjRy((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�qs	ccsx|g}xh|rs|j�}|Vt|t�rN|j|j|jf�qt|t�r|j|j�qqWdS(N(	RMRFRtextendRKRLRR%RO(RjRURR((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR0~s		ccs�|g}x�|r�|j�}t|ttf�r;|Vnt|t�rf|j|j|jf�qt|t�r�|j	|j
�qt|t�r�|jdk	r�|j	|j�q�|Vq|dk	r|VqqWdS(N(RMRFRRRR�RKRLRR%RORR`R6(RjRURR((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytsurface_selectables_only�s		cCs�ttf}t|g�}xi|r�|j�}||jkrJ|j|Sx6|j�D](}t||�rrqWn|j|�qWWqWdS(N(	RRRRst_annotationsRNRFR%R6(Rgtannotation_nametfilter_RURRtsub((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytextract_first_column_annotation�s	cCs%ttt|��jt|���S(s:Return True if left/right have some overlapping selectable(tboolR/R0R1(RKRL((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytselectables_overlap�scs3g��fd�}tj|ii|d6��S(s�Return an ordered list of "bound" values in the given clause.

    E.g.::

        >>> expr = and_(
        ...    table.c.foo==5, table.c.foo==7
        ... )
        >>> bind_values(expr)
        [5, 7]
    cs�j|j�dS(N(R%teffective_value(tbind(tv(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytvisit_bindparam�st	bindparam(RRi(RjR�((R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytbind_values�scCs:t|tj�r,|jdd�}d|St|�SdS(Nt's''s'%s'(RFR!tstring_typesR{trepr(RO((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt_quote_ddl_expr�st
_repr_basecBs)eZdZdZdZdZd�ZRS(iiit	max_charscCs`t|�}t|�}||jkr\|jd}|d|!d||j||}n|S(Niis# ... (%d characters truncated) ... (R�R.R�(tselftvaluetreptlenreptsegment_length((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyttrunc�s
((R�(t__name__t
__module__t_LISTt_TUPLEt_DICTt	__slots__R�(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��s
cCst�}d|_|j|�S(Ni,(R�R�R�(R�trp((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt_repr_single_value�s		t	_repr_rowcBs)eZdZdZdd�Zd�ZRS(sProvide a string view of a row.trowi,cCs||_||_dS(N(R�R�(R�R�R�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt__init__�s	csN|j�ddj�fd�|jD��t|j�dkrFdndfS(Ns(%s%s)s, c3s|]}�|�VqdS(N((t.0R�(R�(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pys	<genexpr>�sit,Rd(R�R[R�R.(R�((R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt__repr__�s	(R�(R�R�t__doc__R�R�R�(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��st_repr_paramscBs>eZdZd	Zdd
d�Zd�Zd�Zd�ZRS(s�Provide a string view of bound parameters.

    Truncates display to a given number of 'multi' parameter sets,
    as well as long values to a given number of characters.

    tparamstbatchestismultii,cCs(||_||_||_||_dS(N(R�R�R�R�(R�R�R�R�R�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�s			cCsG|jdkr|j|j�St|jt�r=|j}nLt|jt�r[|j}n.t|jt	�ry|j
}n|j|j�S|jrt|j�|jkrd}dj
|j|j|jd |�dd!||jt|j�f|j|jd|�df�S|jr0|j|j|�S|j|j|�SdS(Ns8 ... displaying %i of %i total bound parameter sets ... t iii����i����i(R�R6R�R�RFR"R�ttupleR�tdictR�R.R�R[t_repr_multiR�(R�ttyptmsg((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�s&!!	cs�|r�t|dt�r%�j�n^t|dt�rD�j�n?t|dt�rc�j�n ts�tdt	|d���dj
��fd�|D��}nd}|�jkr�d|Sd|SdS(NisUnknown parameter type %ss, c3s!|]}�j|��VqdS(N(R�(R�R�(t	elem_typeR�(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pys	<genexpr>:sRds[%s]s(%s)(RFR"R�R�R�R�R�R8tAssertionErrorttypeR[(R�tmulti_paramsR�telements((R�R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�,scs�|j�||jkr?ddj�fd�|j�D��S||jkr�ddj�fd�|D��t|�dkr�dndfSd	dj�fd
�|D��SdS(Ns{%s}s, c3s+|]!\}}d|�|�fVqdS(s%r: %sN((R�tkeyR�(R�(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pys	<genexpr>Iss(%s%s)c3s|]}�|�VqdS(N((R�R�(R�(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pys	<genexpr>OsiR�Rds[%s]c3s|]}�|�VqdS(N((R�R�(R�(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pys	<genexpr>Ss(R�R�R[titemsR�R.(R�R�R�((R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�Ds	 (R�R�R�N(	R�R�R�R�R6R�R�R�R�(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��s		cs)�fd�}tj|ii|d6�S(sWgiven criterion containing bind params, convert selected elements
    to IS NULL.

    cs�t|jt�rW|jj�krW|j|_t�|_tj|_tj	|_
nKt|jt�r�|jj�kr�t�|_tj|_tj	|_
ndS(N(RFRKRt_identifying_keyRLRRtis_RItis_nottnegate(RE(tnulls(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytvisit_binary\sRE(Rtcloned_traverse(tcritR�R�((R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytadapt_criterion_to_nullVscCs�|dkr|S|dfg}t|�}d}x�|r�|j�\}}t|t�r�||k	r�|j�}|j|j�|_|j|j	|f�n|j|�}|dk	r�||_	n|dkr4|}q4q4W|S(N(
R6t
ClauseAdapterRMRFRt_cloneRiR@R%RK(RKRLtstop_onRUtadaptertrett	prevright((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytsplice_joinsqs"	
c
s�|jdt�}|jdt��tj���tj��x��D]�}x�tg|jD]}|j^q\�D]�}x��D]�}||kr�qny
|j}WnEt	j
k
r�|r�qq��n#t	jk
r�|r�qq��nX|j|�r�s|j
|j
kr�j|�PqqWqrWqFW|r����fd�}x:|D]/}	|	dk	rStj|	ii|d6�qSqSWnt�j���S(sCgiven a list of columns, return a 'reduced' set based on natural
    equivalents.

    the set is reduced to the smallest list of columns which have no natural
    equivalent present in the list.  A "natural equivalent" means that two
    columns will ultimately represent the same value because they are related
    by a foreign key.

    \*clauses is an optional list of join clauses which will be traversed
    to further identify columns that are "equivalent".

    \**kw may specify 'ignore_nonexistent_tables' to ignore foreign keys
    whose tables are not yet configured, or columns that aren't yet present.

    This function is primarily used to determine the most minimal "primary
    key" from a selectable, by reducing the set of primary key columns present
    in the selectable to just those that are not repeated.

    tignore_nonexistent_tablest
only_synonymscs�|jtjkr�tjtg�j��D]}|j^q+��}|j|kr�|j	|kr�xVt
��D]E}|j|j	�rq�s�|j|jjkrq�j
|�PqqqqWq�ndS(N(RIRteqR!RrRR9t	proxy_setRKRLtreversedtshares_lineagetnameRv(RER:Rw(tcolumnstomitR�(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��s.
REN(RMR8R!tordered_column_setRrRR�tforeign_keysRgR tNoReferencedColumnErrortNoReferencedTableErrorR�R�RvR6RRiRR9(
R�R&tkwR�R�R:tfktfk_colR�Rj((R�R�R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytreduce_columns�s:
,




$csf�r�rtjd��nd�������fd�}g�tj|ii|d6��S(s9traverse an expression and locate binary criterion pairs.sSCan only specify one of 'consider_as_foreign_keys' or 'consider_as_referenced_keys'cSs
|j|�S(N(tcompare(tatb((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytcol_is�scs"�r|jtjk	rdSt|jt�sCt|jt�rGdS�r�|j�kr��|j|j�s�|j�kr��j|j|jf�q|j�kr�|j|j�s�|j�kr�j|j|jf�qn0�r�|j�krC�|j|j�s'|j�krC�j|j|jf�q|j�kr�|j|j�sv|j�kr�j|j|jf�qn�t|jt�rt|jt�r|jj	|j�r��j|j|jf�q|jj	|j�r�j|j|jf�qndS(N(
RIRR�RFRKRRLR%Rt
references(RE(tany_operatorR�tconsider_as_foreign_keystconsider_as_referenced_keystpairs(sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��s:RE(R t
ArgumentErrorRRi(t
expressionR�R�R�R�((R�R�R�R�R�sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytcriterion_as_pairs�s	'R�cBsSeZdZdddeedd�Zejd�Zej	d�ed��Z
RS(s5Clones and modifies clauses based on column correspondence.

    E.g.::

      table1 = Table('sometable', metadata,
          Column('col1', Integer),
          Column('col2', Integer)
          )
      table2 = Table('someothertable', metadata,
          Column('col1', Integer),
          Column('col2', Integer)
          )

      condition = table1.c.col1 == table2.c.col1

    make an alias of table1::

      s = table1.alias('foo')

    calling ``ClauseAdapter(s).traverse(condition)`` converts
    condition to read::

      s.c.col1 == table2.c.col1

    cCsci|gd6|d6|_||_||_||_tj|pDi�|_||_||_dS(NR�tanonymize_labels(	t__traverse_options__t
selectablet
include_fnt
exclude_fnR!tcolumn_dicttequivalentstadapt_on_namestadapt_from_selectables(R�R�R�R�R�R�R�R�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�.s


				cCs�|jj|d|�}|dkr�||jkr�||kr�xO|j|D]=}|j|d|d|j|g��}|dk	rM|SqMWn|jr�|dkr�|jjj|j	�}n|S(Ntrequire_embeddedt_seen(
R�tcorresponding_columnR6R�t_corresponding_columnR;R�texported_columnstgetR�(R�R�R�R�tnewcoltequiv((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�Cs	'ssqlalchemy.sql.functionscCs�tjj}t|t�r�t||j�r�|jj|�r~|jrwx+|jD]}|j|�rSPqSqSWdSn|jSt|t
�r�t|jt�r�|SdSn't|t
�s�dS|r�|jr�dSd|jkr�|jd}n|jrB||jkrBx7|jD]%}|jj|t�dk	rPqqWdSn|jr_|j|�r_dS|jr{|j|�r{dS|j|t�SdS(Ntadapt_column(R!t	preloadedt
sql_functionsRFRtFunctionElementR�R$R�R6RRORRt_is_singleton_constantR�R�R:R�R8R�R�R�R7(R�R�t_include_singleton_constantst	functionstadp((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR{Ws<		N(R�R�R�R6R8R�R!t	EMPTY_SETR�tpreload_moduleR{(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�st
ColumnAdapterc	Bs�eZdZd
ed
d
eeed
d�Zdefd��YZd�Z	d�Z
e
Zej
Zd�Zd�Zd�Zd	�ZRS(s�Extends ClauseAdapter with extra utility functions.

    Key aspects of ColumnAdapter include:

    * Expressions that are adapted are stored in a persistent
      .columns collection; so that an expression E adapted into
      an expression E1, will return the same object E1 when adapted
      a second time.   This is important in particular for things like
      Label objects that are anonymized, so that the ColumnAdapter can
      be used to present a consistent "adapted" view of things.

    * Exclusion of items from the persistent collection based on
      include/exclude rules, but also independent of hash identity.
      This because "annotated" items all have the same hash identity as their
      parent.

    * "wrapping" capability is added, so that the replacement of an expression
      E can proceed through a series of adapters.  This differs from the
      visitor's "chaining" feature in that the resulting object is passed
      through all replacing functions unconditionally, rather than stopping
      at the first one that returns non-None.

    * An adapt_required option, used by eager loading to indicate that
      We don't trust a result row column that is not translated.
      This is to prevent a column from being interpreted as that
      of the child row in a self-referential scenario, see
      inheritance/test_basic.py->EagerTargetingTest.test_adapt_stringency

    c

Cs�tj|||d|d|d|d|d|	�tj|j�|_|jsX|jrs|j||j�|_n||_	||_
d|_dS(NR�R�R�R�R�(
R�R�R!tWeakPopulateDictt_locate_colR�R�R�t_IncludeExcludeMappingtadapt_requiredtallow_label_resolveR6t_wrap(
R�R�R�RR�R�R�RR�R�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��s		RcBseZd�Zd�ZRS(cCs||_||_dS(N(tparentR�(R�RR�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR��s	cCsl|jjr|jj|�s=|jjra|jj|�ra|jjrZ|jjj|S|Sn|j|S(N(RR�R�RR�(R�R�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt__getitem__�s(R�R�R�R(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�s	cCsw|jj|j�}|jj|j�||_tj|j�|_|j	sX|j
rs|j||j�|_n|S(N(t	__class__t__new__t__dict__ReRR!R
RR�R�R�R(R�R�tac((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytwrap�s	cCs|j|S(N(R�(R�tobj((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyRi�scCs9|j|}||kr5|j|t�dkr5dS|S(N(R�R�R7R6(R�R�R((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pytadapt_check_present�s
$cCs�|jrKxQ|jD]+}|j|dt�}|dk	rPqqW|}ntj||�}|jr�|jj|�}|dk	r�|}q�n|j	r�||kr�dS|j
|_|S(NR(t
_is_immutabletvisitor_iteratorR{R7R6R�RiRRRRt_allow_label_resolve(R�R�tvisR:tc2((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�s			cCs|jj�}|d=|S(NR�(Rtcopy(R�td((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt__getstate__scCs)|jj|�tj|j�|_dS(N(RReR!R
RR�(R�tstate((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt__setstate__sN(R�R�R�R6R8R7R�tobjectRRRitadapt_clauseR�tcopy_and_processt
adapt_listRRR#R%(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyR�s$	
				!	cCstjtj|d|d|�S(s�Convert the given value to an "offset or limit" clause.

    This handles incoming integers and converts to an expression; if
    an expression is already given, it is passed through.

    R�ttype_(RtexpectRtLimitOffsetRole(ROR�R*((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt_offset_or_limit_clause$scCs=|dkrdSt|d�r5|j}tj|�S|SdS(sdReturn the offset or limit clause as a simple integer if possible,
    else return the clause.

    t_limit_offset_valueN(R6thasattrR.R!tasint(RjR�((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt)_offset_or_limit_clause_asint_if_possible0s	
cCs-|dk	r�|dk	r�t|�}|dkr9d}n|dkrR||}n|dkrgd}nt|�}t||�}n�|dkr�|dk	r�t|�}nv|dk	r#|dkr#t|�}|dkr�d}n|dkr�||}n|dkrd}q#t|�}n||fS(s0Compute LIMIT/OFFSET in terms of slice start/endiN(R6R1R-(tlimit_clauset
offset_clausetstarttstop((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt_make_slice>s0		
			
	N(RR�tcollectionsRt	itertoolsRRdRRRRt
annotationRRRtbaseR	R
RtddlRR�R
RRRRRRRRRtschemaRR�RRRRRRRt
traversalsRR R!tlanghelperstpublic_factoryt_join_conditiontjoin_conditionR-R5RDRXR8RqRzR}R�R�R�R0R�R�R�R�R�R&R�R�R�R�R�R6R�R�R�tReplacingExternalTraversalR�RR-R1R6(((sD/opt/alt/python27/lib/python2.7/site-packages/sqlalchemy/sql/util.pyt<module>
s�			*	4	A$	/				
							X		M;��