$10 GRAYBYTE WORDPRESS FILE MANAGER $87

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.174
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/hc_python/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/

HOME
Current File : /opt/hc_python/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__//util.cpython-312.pyc
�

N��gֻ��"�dZddlmZddlmZddlZddlmZddlZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddl m!Z!ddl m"Z"ddl m#Z#ddl$m%Z%dd l$m&Z&dd!l'm(Z(dd"l)m*Z*dd#l+m,Z,dd$l+m-Z-dd%l+m.Z.dd&l+m/Z/dd'l+m0Z0dd(l+m1Z1dd)l+m2Z2dd*l+m3Z3dd+l+m4Z4dd,l+m5Z5dd-l+m6Z6dd.l+m7Z7dd/l+m8Z8dd0l9m:Z:dd1l;m<Z<dd2l;m=Z=dd3l;m>Z>dd4l;m?Z?dd5l;m@Z@dd6l;mAZAdd7l;mBZBdd8lmCZCd9d:lmDZDd9d;lmEZEd9d<lFmGZGd9d=lFmHZHej,r`dd>lmIZIdd?lmJZJdd@lmKZKddAl+mLZLddBl+mMZMddCl;mNZNddDl;mOZOddEl;mPZPddFlmQZQddGlmRZRddHlmSZSd9dIlTmUZUd9dJlTmVZVd9dKlTmWZWd9dLlTmXZXd9dMlYmZZZedNdO�P�Z[		d|									d}dQ�Z\						d~dR�Z]						ddS�Z^								d�dT�Z_						d�dU�Z`dVdVdVdVdVdW�													d�dX�Zad�dY�ZbdZ�Zcd[�Zdd\�Zed�d]�Zfd^�Zgd_�Zhd`�Zid�da�Zjdb�Zkdc�ZlGdd�de�Zmdf�ZnGdg�dhem�ZoGdi�djep�ZqGdk�dlem�Zrd�dm�Zs	d�							d�dn�Zte								d�do��Zue								d�dp��Zu								d�dq�Zu			d�dr�ZvGds�dtej��ZxGdu�dveH�ZyGdw�dxex�Zz		d|							d�dy�Z{				d�dz�Z|										d�d{�Z}y)�z;High level utilities which build upon other modules here.

�)�annotations)�dequeN)�chain)�AbstractSet)�Any)�Callable)�cast)�
Collection)�Dict)�Iterable)�Iterator)�List)�Optional)�overload)�Sequence)�Tuple)�
TYPE_CHECKING)�TypeVar)�Union�)�	coercions)�	operators)�roles)�visitors��is_text_clause)�_deep_annotate)�_deep_deannotate)�_shallow_annotate)�_expand_cloned)�
_from_objects)�HasCacheKey)�sort_tables)�
_find_columns)�_label_reference)�_textual_label_reference)�
BindParameter)�
ClauseElement)�ColumnClause)�
ColumnElement)�Grouping)�KeyedColumnElement)�Label)�NamedColumn)�Null)�UnaryExpression)�Column)�Alias)�
FromClause)�FromGrouping)�Join)�ScalarSelect)�
SelectBase)�TableClause)�_ET�)�exc)�util)�Literal)�Protocol)�_EquivalentColumnMap)�_LimitOffsetType)�_TypeEngineArgument)�BinaryExpression)�
TextClause)�_JoinTargetElement)�_SelectIterable)�
Selectable)�_TraverseCallableType)�ExternallyTraversible)�ExternalTraversal)�_AnyExecuteParams)�_AnyMultiExecuteParams)�_AnySingleExecuteParams)�_CoreSingleExecuteParams)�Row�_CE�ColumnElement[Any])�boundc�4�tj||||��S)aCreate a join condition between two tables or selectables.

    e.g.::

        join_condition(tablea, tableb)

    would produce an expression along the lines of::

        tablea.c.id == tableb.c.tablea_id

    The join is determined based on the foreign key relationships
    between the two selectables.   If there are multiple ways
    to join, or no way to join, an error is raised.

    :param a_subset: An optional expression that is a sub-component
        of ``a``.  An attempt will be made to join to just this sub-component
        first before looking at the full ``a`` construct, and if found
        will be successful even if there are other ways to join to ``a``.
        This allows the "right side" of a join to be passed thereby
        providing a "natural join".

    )�a_subset�consider_as_foreign_keys)r5�_join_condition)�a�brSrTs    �D/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/sql/util.py�join_conditionrY_s#��8���	�	��!9�	��c��tt|��}g}t|�D]/\}}|D]%}|j|�s�|j	|��'�1|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�ss       rX�find_join_sourcerg�sU��&�}�W�-�.�K�
�C��'�"���1��A�� � ��#��
�
�1�
��#��JrZc�z�tt|��}g}t|�D]0\}}|D]&}|j|�s�|j	|��0�2t|�dkDrXg}|D]M}||}|D]A}t
t|��jt|��s�0|j	|��M�O|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]r^r_�len�set�surface_selectables�intersection)	r`�	join_fromrb�liberal_idxrdrerf�conservative_idxrcs	         rX�#find_left_clause_that_matches_givenrp�s����}�Y�/�0�K��K��'�"���1��A�� � ��#��"�"�1�%���#�"�;��!�����C����A� ���*�1�-�.�;�;�'��*��%�+�+�C�0��!���#�#��rZc
���g}tt|��}t|�dkDr|�d}t|�}nd}d}t	|�D]�\}}|j|g�D]�}	|rU|�J�t|j�j|	j�j|�s�G|j|��r|�tj||	�s�s|j|�����t|�dkDrItt|D�cgc]}t|j���c}��}
|D�cgc]}|||
vs�|��}}|s|�tt!t|���S|Scc}wcc}w)a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.

    rNTF)rjr!rir$r]�
difference�c�union�
issupersetr_r5�	_can_joinrr �_hide_fromsr\�range)r`ra�onclausercrb�resolve_ambiguity�cols_in_onclauserdrerf�toremoves           rX�find_left_clause_to_join_fromr}�sZ�� 
�C��m�G�,�-�K��7�|�a��H�0� ��(��2��!�����'�"���1��'�'���,�A� �'�3�3�3��q�s�s�8�>�>�!�#�#�&�1�1�2B�C��J�J�q�M���%�����1�)=��
�
�1�
��-�#��3�x�!�|���7�C�7�a�N�1�=�=�1�7�C�D�
���<�#�Q����8�!;�q�#��<��8�'��E�#�g�,�'�(�(��
��D��<s�E�)E$�6E$c�D����g�d���fd��t�|��d�y)a�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:

    .. sourcecode:: text

        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.

    c3��K�t|t�r|��y|jdk(r�tj|j
�r|�j
d|��|j�D]&}�|j�D]}��d||���(�jd�|j�D]
}�|��yt|t�r|��|j�D]}�|�Ed{����y7��w)N�binaryr)�
isinstancer6�__visit_name__r�
is_comparison�operator�insert�left�right�pop�get_childrenr))�element�l�r�elem�fn�stack�visits    ���rXr�z#visit_binary_product.<locals>.visit-s�������g�|�,��M�
�
#�
#�x�
/�I�4K�4K����5
�
�L�L��G�$��7�<�<�(���w�}�}�-�A��u�Q�x��A�&�.�)�
�I�I�a�L��,�,�.���d��/��'�<�0��
��,�,�.�� ��;�&�&�/�&�s�C2C?�5C=�6C?N)r�r(�returnzIterator[ColumnElement[Any]])r\)r��exprr�r�s` @@rX�visit_binary_productr�s#���N*,�E�'�*	��t����ErZF)�
check_columns�include_aliases�
include_joins�include_selects�include_crudc�*��g�i}|r�jx|d<|d<|r�j|d<|r�jx|d<x|d<x|d<|d<|r�fd�x|d	<x|d
<|d<|r
�fd�}||d
<�j|d<tj|i|��S)z1locate Table objects within the given expression.�select�compound_select�join�alias�subquery�tablesample�lateralc�:���j|j�S�N�r_�table)�ent�tabless �rX�<lambda>zfind_tables.<locals>.<lambda>as����
�
�c�i�i�0rZr��update�deletec�<���j|j�yr�r�)�columnr�s �rX�visit_columnz!find_tables.<locals>.visit_columnfs����M�M�&�,�,�'rZr�r�)r_r�traverse)	�clauser�r�r�r�r��	_visitorsr�r�s	        @rX�find_tablesr�Fs����!#�F�79�I��=C�]�]�J�	�(��i�(9�:��"�M�M�	�&���$*�=�=�	1�	�'��	1�Y�z�2�	1�Y��6
��i� ��0�	
�	�(��	
�i��1�I�h�4G��	(�+�	�(�����I�g�����f�b�)�,��MrZc���tj�}g}t|g�}|�rC|j�}t	|t
�r�t	|t�rtj|j�s�t	|t�rTt	|jt�s:|j}t	|t�r|j}|j|���t	|t�r|j}|j|���t	|t �r��||vrI|j#|�|j|�n&|j%�D]}|j|��|r��C|S)zqBreak up an 'order by' expression into individual column-expressions,
    without DESC/ASC/NULLS FIRST/NULLS LAST)r<�
column_setr�popleftr�r*r0r�is_ordering_modifier�modifierr-r�r6r+r_r%r&�addr�)r��cols�resultr��trss      rX�unwrap_order_byr�qs���?�?��D�
�F��6�(�O�E���M�M�O���a��'��1�o�.��1�1�!�*�*�=��!�U�#�J��	�	�<�-��I�I���a��*��	�	�A����Q����A�/�0��I�I�����Q����!�6�8����}�������
�
�a� ��^�^�%�����Q��&�9�<�MrZc�D�						dd�}tj|i|�S)Nc�j�t|t�r|jSt|t�rJd��y)Nz&can't unwrap a textual label reference)r�r%r�r&)r��kws  rX�replacez'unwrap_label_reference.<locals>.replace�s2���g�/�0��?�?�"�
��!9�
:�B�B�B�5�rZ)r�rHr�rr��Optional[ExternallyTraversible])r�replacement_traverse)r�r�s  rX�unwrap_label_referencer��s6���&��.1��	(���(�(��"�g�>�>rZc
���|D�chc]}|j�|jn|��}}tt|D�cgc]
}t	|���c}��}|D�cgc]	}||vs�|��c}Scc}wcc}wcc}w)z�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.

    )�_order_by_label_elementr�r\rr�)�collist�order_by�col�cols_already_present�o�to_look_fors      rX� expand_column_list_from_order_byr��s������C��2�2�>����C�G����
�u�8�D�8�a��q�1�8�D�E�F�K�&�J�;�C�#�5I�*I�C�;�J�J����
E��Js�!A%�A*�	A/�A/c�2�t|�D]	}||k(s�	yy)z�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.

    TF)rk)r��searchr�s   rX�clause_is_presentr��s"��$�F�+���T�>��,�rZc#�K�t|t�r;t|j�Ed{���t|j�Ed{���yt|t
�rt|j�Ed{���y|��y7�U7�:7��wr�)r�r5�tables_from_leftmostr�r�r4r�)r�s rXr�r��sb�����&�$��'����4�4�4�'����5�5�5�	�F�L�	)�'����7�7�7���	5��5��7�s3�)B�B�B�B�	-B�6B�7B�B�Bc#�K�|g}|r{|j�}|��t|t�r(|j|j|j
f�n+t|t�r|j|j�|r�zyy�wr�)	r�r�r5�extendr�r�r4r_r��r�r�r�s   rXrkrk�sb����
�H�E�
��y�y�{���
��d�D�!��L�L�$�)�)�T�Z�Z�0�1�
��l�
+��L�L����&�
�s�A?B�Bc#�K�|g}|r�|j�}t|ttf�r|��t|t�r(|j|j|jf�not|t�r|j|j�nCt|t�r-|j�|j|j�n|��n|�|��|r��yy�wr�)
r�r�r8r2r5r�r�r�r4r_r�r)r�r�s   rX�surface_selectables_onlyr��s�����
�H�E�
��y�y�{���d�[�%�0�1��J��d�D�!��L�L�$�)�)�T�Z�Z�0�1�
��l�
+��L�L����&�
��l�
+��z�z�%����T�Z�Z�(��
�
�
��J��s�CC�Cc��ttf}t|g�}|rc|j�}||jvr|j|S|j�D] }t
||�r�|j|��"|r�cyr�)r4r7rr��_annotationsr�r�r_)r��annotation_name�filter_r�r��subs      rX�extract_first_column_annotationr��sz���Z�(�G��6�(�O�E�
��}�}����d�/�/�/��$�$�_�5�5��$�$�&�C��#�w�'���L�L���'�	�rZc�l�ttt|��jt|���S)z:Return True if left/right have some overlapping selectable)�boolrjrkrl)r�r�s  rX�selectables_overlapr�s0������%�&�3�3�4G��4N�O��rZc�H��g��fd�}tj|id|i��S)z�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]
    c�<���j|j�yr�)r_�effective_value)�bind�vs �rX�visit_bindparamz$bind_values.<locals>.visit_bindparams���	����%�%�&rZ�	bindparam)rr�)r�r�r�s  @rX�bind_valuesr�
s-���	�A�'�
���f�b�;��"@�A��HrZc�f�t|t�r|jdd�}d|zSt|�S)N�'z''z'%s')r��strr��repr)r�s rX�_quote_ddl_exprr� s1���'�3���/�/�#�t�,�������G�}�rZc�N�eZdZUdZded<dZded<dZded<dZded	<dd
�Zy)
�
_repr_baser�int�_LISTr�_TUPLEr:�_DICT)�	max_charsr�c��t|�}t|�}||jkDr.|jdz}|d|d||jz
zz||dz}|S)Nr:rz# ... (%d characters truncated) ... )r�rir�)�self�value�rep�lenrep�segment_lengths     rX�truncz_repr_base.trunc1sq���5�k���S����D�N�N�"�!�^�^�q�0�N��A�n�%�9�����.�0��
�~�o�&�'�(�
��
rZN)r�rr�r�)	�__name__�
__module__�__qualname__r��__annotations__r�r��	__slots__r��rZrXr�r�(s,���E�3�N��F�C�O��E�3�N��I��N�
rZr�c�F�t�}d|_|j|�S)N�,)r�r�r�)r��rps  rX�_repr_single_valuerAs��	��B��B�L�
�8�8�E�?�rZc�&�eZdZdZdZddd�Zdd�Zy)	�	_repr_rowzProvide a string view of a row.)�rowc� �||_||_yr�)rr�)r�rr�s   rX�__init__z_repr_row.__init__Ls�����"��rZc���|j�ddj�fd�|jD���t|j�dk(rd�d�Sd�d�S)N�(�, c3�.�K�|]}�|����y�wr�r���.0r�r�s  �rX�	<genexpr>z%_repr_row.__repr__.<locals>.<genexpr>Ss�����9��u�e�E�l����r�,��))r�r�rri)r�r�s @rX�__repr__z_repr_row.__repr__PsQ����
�
���I�I�9����9�9��t�x�x�=�A�%�C�-�
�	
�+-�-�
�	
rZN)r)rzRow[Any]r�r��r�r�)r�r�r��__doc__r�rrr�rZrXrrGs��)��I�#�
rZrc��eZdZdd�Zy)�_long_statementc��t|�}|dkDrd}d}||z
|z
}|d|�d|�d||d��Stj|�S)Ni���dr� ... z characters truncated ... )rir��__str__)r��lself�lleft�lrightr�s     rXrz_long_statement.__str__Ysi���D�	���3�;��E��F��E�M�F�*�E���%�=�/��u�g�.,�,0�&���N�+;�=�
�
�;�;�t�$�$rZNr)r�r�r�rr�rZrXrrXs��%rZrc��eZdZdZdZ			d									d
d�Zdd�Z						dd�Zdd�Z						dd�Z	dd	�Z
dd
�Zdd�Zy)�_repr_paramsz�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.

    )�params�batches�ismulti�
max_paramsNc�J�||_||_||_||_||_yr�)r"r$r#r�r%)r�r"r#r%r�r$s      rXrz_repr_params.__init__qs'�����������"���$��rZc	�J�|j�|j|j�St|jt�r
|j
}nit|jt�r
|j}nBt|jt�r
|j}n|j|j�S|jr�td|j�}t|j�|jkDrqd}dj|j|d|jdz
|�dd||jt|j�fz|j|dd|�ddf�S|j||�S|jtd	|j�|�S)
NrKz8 ... displaying %i of %i total bound parameter sets ... � r:r������rrL)r$r�r"r�r\r��tupler��dictr�r	rir#r��_repr_multir!)r��typ�multi_params�msgs    rXrz_repr_params.__repr__ss���<�<���:�:�d�k�k�*�*��d�k�k�4�(��*�*�C�
����U�
+��+�+�C�
����T�
*��*�*�C��:�:�d�k�k�*�*��<�<��(�����L�
�4�;�;��$�,�,�.�N���x�x��(�(�(�);�4�<�<�!�+;�<����B� ��t�|�|�S����-=�>�>��(�(��b�c�):�C�@���D�
�	�	��'�'��c�:�:��$�$��-��K�K����
rZc�d���|r�t|dt�r
�j�nVt|dt�r
�j�n6t|dt
�r
�j�nJdt|d�z��dj��fd�|D��}nd}|�jk(rd|zSd|zS)NrzUnknown parameter type %sr
c3�B�K�|]}�j|�����y�wr�)r!)r
r"�	elem_typer�s  ��rXrz+_repr_params._repr_multi.<locals>.<genexpr>�s"�����!�CO���!�!�&�)�4�<�s�r�[%s]z(%s))	r�r\r�r+r�r,r��typer�)r�r/r.�elementsr3s`   @rXr-z_repr_params._repr_multi�s����
��,�q�/�4�0� �J�J�	��L��O�U�3� �K�K�	��L��O�T�2� �J�J�	��9���a��)���u��y�y�!�CO�!��H��H��$�*�*���H�$�$��H�$�$rZc��t|�}t|�}||jkDr(|jdz}|d|||d||jz
fS|ddfS)Nr:r)r\rir%)r�r"�lparams�	lenparamsrs     rX�_get_batchesz_repr_params._get_batches�si���v�,����L�	��t���&��O�O�q�(�E���%� ����� ��D�O�O�+��
��D�$�&�&rZc���||jur|jtd|��S||jur|j	td|��S|j|�S)NrM�
Sequence[Any])r��_repr_param_dictr	r��_repr_param_tuple�_repr_param_list)r�r"r.s   rXr!z_repr_params._repr_params�se��
�$�*�*���(�(��/��8��
��D�K�K�
��)�)�$���*G�H�H��(�(��0�0rZc�4��|j�|j|j��\}}}|rHddj�fd�|D��z}|d|�d�z
}|ddj�fd�|D��zz
}|Sddj�fd	�|D��z}|S)
Nz{%sr
c3�>�K�|]\}}|�d�|������y�w�z: Nr��r
�keyr�r�s   �rXrz0_repr_params._repr_param_dict.<locals>.<genexpr>��,������&7�
��U��g�R��e��~�.�&7���r� parameters truncated ... z%s}c3�>�K�|]\}}|�d�|������y�wrBr�rCs   �rXrz0_repr_params._repr_param_dict.<locals>.<genexpr>�s,������&8�
��U��g�R��e��~�.�&8�rFz{%s}c3�>�K�|]\}}|�d�|������y�wrBr�rCs   �rXrz0_repr_params._repr_param_dict.<locals>.<genexpr>�rErF)r�r:�itemsr��r�r"�items_first_batch�items_second_batch�trunclen�textr�s      @rXr=z_repr_params._repr_param_dict�s�����
�
��

���f�l�l�n�-�		
�������	�	��&7����D�
�e�H�:�%?�@�@�D��E��	�	��&8����
�D���
��	�	��&7����D��rZc�>��|j�|j|�\}}}|rHddj�fd�|D��z}|d|�d�z
}|dj�fd�|D���d�z
}|Sddj�fd	�|D���t|�d
k(rdnd�d�}|S)
Nz(%sr
c3�.�K�|]}�|����y�wr�r�rs  �rXrz1_repr_params._repr_param_tuple.<locals>.<genexpr>
������F�4E�5�%��,�4E�rrrGc3�.�K�|]}�|����y�wr�r�rs  �rXrz1_repr_params._repr_param_tuple.<locals>.<genexpr>������G�4F�5�%��,�4F�rrr	c3�.�K�|]}�|����y�wr�r�rs  �rXrz1_repr_params._repr_param_tuple.<locals>.<genexpr>rRrrrr)r�r:r�rirKs      @rXr>z_repr_params._repr_param_tuples�����
�
��
���f�%�		
�������	�	�F�4E�F�F��D�
�e�H�:�%?�@�@�D���	�	�G�4F�G�G��
�D�����	�	�F�4E�F�F��,�-��2���:��D��rZc���|j�|j|�\}}}|rHddj�fd�|D��z}|d|�d�z
}|ddj�fd�|D��zz
}|Sddj�fd	�|D��z}|S)
Nz[%sr
c3�.�K�|]}�|����y�wr�r�rs  �rXrz0_repr_params._repr_param_list.<locals>.<genexpr>$rRrrrGz%s]c3�.�K�|]}�|����y�wr�r�rs  �rXrz0_repr_params._repr_param_list.<locals>.<genexpr>(rTrr4c3�.�K�|]}�|����y�wr�r�rs  �rXrz0_repr_params._repr_param_list.<locals>.<genexpr>,rRr)r�r:r�rKs      @rXr?z_repr_params._repr_param_lists�����
�
��

���f�%�		
�������	�	�F�4E�F�F��D�
�e�H�:�%?�@�@�D��E��	�	�G�4F�G�G��
�D�����	�	�F�4E�F�F��D��rZ)rrN)
r"zOptional[_AnyExecuteParams]r#r�r%r�r�r�r$zOptional[bool]r)r/rKr.r�r�r�)r"z
Iterable[Any]r�r)r"rLr.r�r�r�)r"rMr�r�)r"r<r�r�)r"rLr�r�)
r�r�r�rr�rrr-r:r!r=r>r?r�rZrXr!r!gs����=�I���"&�
%�+�%��%��	%�
�%� �
%�+�Z%�,�%��%�

�	%�8'�1�'�1��1�

�	1��>�0rZr!c�@���fd�}tj|id|i�S)zWgiven criterion containing bind params, convert selected elements
    to IS NULL.

    c����t|jt�rc|jj�vrK|j|_t�|_tj|_tj|_
yt|jt�rS|jj�vr:t�|_tj|_tj|_
yyyr�)r�r�r'�_identifying_keyr�r/r�is_r��is_not�negate)r��nullss �rX�visit_binaryz-adapt_criterion_to_null.<locals>.visit_binary7s�����v�{�{�M�2����,�,��5�!�,�,�F�K��6�F�L�'�m�m�F�O�%�,�,�F�M��v�|�|�]�3����-�-��6��6�F�L�'�m�m�F�O�%�,�,�F�M�	7�
4rZr�)r�cloned_traverse)�critr`ras ` rX�adapt_criterion_to_nullrd1s$���-�$�#�#�D�"�x��.F�G�GrZc�j�|�|S|dfg}t|�}d}|r�|j�\}}t|t�rR||urN|j	�}|j|j�|_|j|j|f�n|j|�}|�|�J�||_|�|}|r��|Sr�)	�
ClauseAdapterr�r�r5�_cloner�ryr_r�)r�r��stop_onr��adapter�ret�	prevrights       rX�splice_joinsrlLs���
�|���AF��
��E��D�!�G�
�C�
�"�Y�Y�[���	��e�T�"�u�G�';��L�L�N�E�$�-�-�e�n�n�=�E�N��L�L�%�*�*�e�,�-��$�$�U�+�E�� ��$�$�$�"�I�N��;��C���JrZc��yr�r���columnsr`r�s   rX�reduce_columnsrpis��
$'rZc��yr�r�rns   rXrprpqs��
7:rZc�����
�|jdd�}|jdd��
tj|�}|jd�|D���tj���D]�}t|jD�cgc]}|j��c}�D][}�D]T}||ur�	|j}|j|�s�'�
r|j|jk(s�C�j|��[�]��|r*���
fd�}	|D]}
|
��tj |
id|	i�� |j��Scc}w#tj$r|rY���tj$r|rY�˂wxYw)aCgiven 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.

    �ignore_nonexistent_tablesF�
only_synonymsc3�8K�|]}t|�s�|���y�wr�r)r
rss  rXrz!reduce_columns.<locals>.<genexpr>�s����N��a���!2��:�s��c����|jtjk(r�tjt�j
��D�cgc]}|j��c}��}|j|vrt|j|vret��D]V}|j|j�s��r$|j|jjk(s�E�j|�yyyyycc}wr�)r�r�eqr<r�rrr�	proxy_setr�r��reversed�shares_lineage�namer�)r�rsr��cset_no_text�omitrts   ���rXraz$reduce_columns.<locals>.visit_binary�s�������)�,�,�.�����/;�/F�/F�t�/L�M�/L�!�!�+�+�/L�M����
�;�;�$�&�6�<�<�4�+?�%�l�3���+�+�F�L�L�9� -����6�;�;�;K�;K�1K� �H�H�Q�K�!�4�,@�&�
/��Ns�C%r�)r�r<�
OrderedSetrrr�rrx�foreign_keysr�r;�NoReferencedColumnError�NoReferencedTableErrorrzr{r�rr�)ror`r�rsr�r�rs�fk�fk_colrar�r|r}rts           @@@rXrprpysm���0!#���'B�E� J���F�F�?�E�2�M�����)�J�8B�8M�8M�N��N�9�L��?�?��D����#�-�-�@�-�Q�!�.�.�-�@�A�B�!����8����Y�Y�F��(�(��+�%����3�8�8�);��H�H�S�M��/"�B��6�
	"��F��!��!�!�&�"�x��.F�G��� � ��&�&��_A���2�2��1� ���1�1��1� ��
�s�D5
�&D:�:E*	�E*	�(E*	c��������r�rtjd��d�������fd�}g�tj|id|i��S)z9traverse an expression and locate binary criterion pairs.zSCan only specify one of 'consider_as_foreign_keys' or 'consider_as_referenced_keys'c�$�|j|�Sr�)�compare)rVrWs  rX�col_isz"criterion_as_pairs.<locals>.col_is�s���y�y��|�rZc�f���s|jtjuryt|jt
�rt|jt
�sy�r�|j�vrS�|j|j�s|j�vr(�j|j|jf�y|j�vrT�|j|j�s|j�vr(�j|j|jf�yyy�r�|j�vrS�|j|j�s|j�vr(�j|j|jf�y|j�vrT�|j|j�s|j�vr(�j|j|jf�yyyt|jt�r�t|jt�r�|jj|j�r(�j|j|jf�y|jj|j�r(�j|j|jf�yyyyr�)
r�rrwr�r�r*r�r_r1�
references)r��any_operatorr�rT�consider_as_referenced_keys�pairss �����rXraz(criterion_as_pairs.<locals>.visit_binary�s��������y�|�|� C���&�+�+�}�5�Z��L�L�-�>
�
�#��{�{�6�6��v�|�|�V�[�[�1��<�<�'?�?����f�l�l�F�K�K�8�9����!9�9��v�{�{�F�L�L�1��;�;�&>�>����f�k�k�6�<�<�8�9�?�:�
)��{�{�9�9��v�|�|�V�[�[�1��<�<�'B�B����f�k�k�6�<�<�8�9����!<�<��v�{�{�F�L�L�1��;�;�&A�A����f�l�l�F�K�K�8�9�B�=��&�+�+�v�.�:����f�4��;�;�)�)�&�,�,�7��L�L�&�,�,����!<�=��\�\�,�,�V�[�[�9��L�L�&�+�+�v�|�|�!<�=�:�4�.rZr�)r;�
ArgumentErrorrr�)�
expressionrTr�r�rar�r�s ``` @@rX�criterion_as_pairsr��sX��� �$?����
,�
�	
��%>�%>�NBD�E����j�"�x��&>�?��LrZc���eZdZdZdZ						d													dd�Zered
d��Zedd��Z				dd�Ze	jfd�Ze	jd	�	d					dd
��Z
y)rfaYClones 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

    )�__traverse_options__�
selectable�
include_fn�
exclude_fn�equivalents�adapt_on_names�adapt_from_selectablesNc��|g|d�|_||_||_||_t	j
|xsi�|_||_||_y)N)rh�anonymize_labels)	r�r�r�r�r<�column_dictr�r�r�)r�r�r�r�r�r�r�r�s        rXrzClauseAdapter.__init__5sU��#�|� 0�%
��!�%���$���$����+�+�K�,=�2�>���,���&<��#rZc��yr�r��r��objs  rXr�zClauseAdapter.traverseLs��8;rZc��yr�r�r�s  rXr�zClauseAdapter.traverseWs��-0rZc��yr�r�r�s  rXr�zClauseAdapter.traverseZs��.1rZc�~�|jj||��}|�P||jvrB||vr>|j|D],}|j|||j	|g���}|��*|cS|j
rA|�?t
|t�r/|jjj|j�}|S)N��require_embedded)r��_seen)r��corresponding_columnr��_corresponding_columnrtr�r�r.�exported_columns�getr{)r�r�r�r��newcol�equivs      rXr�z#ClauseAdapter._corresponding_column^s������5�5��"2�6�
���>�c�T�%5�%5�5�#�U�:J��)�)�#�.���3�3��%5��+�+�s�e�,�4���
�%�!�M�/�
������3��,��_�_�5�5�9�9�#�(�(�C�F��
rZzsqlalchemy.sql.functionsc��tjj}|jr|j|�sy|jr|j	|�ryt|t�r�t||j�s�|jj|�rH|jr0|jD] }|j|�s�|jSy|jSt|t�rt|jt�r|Syt|t�sy|s
|jryd|j vr|j d}t"rt|t$�sJ�|jr>||j&vr0|jD] }|j(j+|d��� nyt"rt|t$�sJ�|j-|d��S)N�adapt_columnFTr�)r<�	preloaded�
sql_functionsr�r�r�r3�FunctionElementr�r^r�r2r�r8r*�_is_singleton_constantr�rr,r�rsr�r�)r�r��_include_singleton_constants�	functions�adps     rXr�zClauseAdapter.replacevs����N�N�0�0�	��?�?�4�?�?�3�#7��
�_�_�����!5���c�:�&�z���*�*�0
����.�.�s�3��.�.�#�:�:���.�.�s�3�!����&� ;� $����&��C��'�J����[�-��
�
��C��/��-�#�2L�2L���S�-�-�-��"�"�>�2�C���c�#5�6�6�6��&�&�3�d�6F�6F�+F��2�2���5�5�-�-�c�5�9�E��3����c�#5�6�6�6��)�)��$�*�
�	
rZ)NNNFFN)r�rFr��Optional[_EquivalentColumnMap]r��)Optional[Callable[[ClauseElement], bool]]r�r�r�r�r�r�r��!Optional[AbstractSet[FromClause]]�r�z
Literal[None]r��None�r�r9r�r9�r�r�r�r�)F)r�r9r�r�r�z
Optional[_ET])r�r�r�rr�rrrr�r<�	EMPTY_SETr��preload_moduler�r�rZrXrfrfs����<�I�7;�@D�@D�$�!&�DH�=��=�4�=�>�	=�
>�=��
=��=�!B�=�*�	�;�
�;�
�0�
�0�	2�6�	2�
,�	2�
,0�>�>��0�T���3�4�=B�F
��F
�6:�F
�	�F
�5�F
rZrfc�\�eZdZedd��Zedd��Zed	d��Zed
d��Zdd�Zy)�
_ColumnLookupc��yr�r��r�rDs  rX�__getitem__z_ColumnLookup.__getitem__�s��.1rZc��yr�r�r�s  rXr�z_ColumnLookup.__getitem__�s��HKrZc��yr�r�r�s  rXr�z_ColumnLookup.__getitem__�s��JMrZc��yr�r�r�s  rXr�z_ColumnLookup.__getitem__�s��,/rZc��yr�r�r�s  rXr�z_ColumnLookup.__getitem__�s��CrZN)rDr�r�r�)rD�ColumnClause[Any]r�r�)rDrPr�rP)rDr9r�r9)rDrr�r)r�r�r�rr�r�rZrXr�r��s=��
�1��1�
�K��K�
�M��M�
�/��/�/rZr�c���eZdZUdZdZded<								d																	d�fd�
ZGd�d�Zd�Ze	dd	��Z
e	dd
��Z
				dd�Z
d�fd�Zer	e
dd
��Ze
Zej"Z				dd�Z				dd�Z�xZS)�
ColumnAdaptera�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

    )ro�adapt_required�allow_label_resolve�_wrap�__weakref__r�roc
	���t�
|�|||||||	��tj|j�|_|js|jr!|j||j
�|_||_	||_
d|_y)N)r�r�r�r�r�)�superrr<�WeakPopulateDict�_locate_colror�r��_IncludeExcludeMappingr�r�r�)r�r�r�r�r�r�r�r�r�r��	__class__s          �rXrzColumnAdapter.__init__�s����	�����!�!�)�-�#9�	�	
��,�,�T�-=�-=�>����?�?�d�o�o��6�6�t�T�\�\�J�D�L�,���#6�� ���
rZc��eZdZd�Zd�Zy)�$ColumnAdapter._IncludeExcludeMappingc� �||_||_yr�)�parentro)r�r�ros   rXrz-ColumnAdapter._IncludeExcludeMapping.__init__s�� �D�K�"�D�LrZc�Z�|jjr|jj|�r1|jjrV|jj|�r;|jjr#|jjj|S|S|j|Sr�)r�r�r�r�ror�s  rXr�z0ColumnAdapter._IncludeExcludeMapping.__getitem__sz�����&�&�t�{�{�/E�/E�c�/J��+�+�(�(�T�[�[�-C�-C�C�-H��;�;�$�$��;�;�,�,�4�4�S�9�9��J��<�<��$�$rZN)r�r�r�rr�r�rZrXr�r�s��	#�	%rZr�c��tj|�}||_tj|j�|_|js|jr!|j||j
�|_|Sr�)	�copyr�r<r�r�ror�r�r�)r�ri�acs   rX�wrapzColumnAdapter.wrap%sV��
�Y�Y�t�_������*�*�2�>�>�:��
�
�=�=�B�M�M��4�4�R����D�B�J��	rZc��yr�r�r�s  rXr�zColumnAdapter.traverse.s��47rZc��yr�r�r�s  rXr�zColumnAdapter.traverse1s��),rZc� �|j|Sr�)ror�s  rXr�zColumnAdapter.traverse4s���|�|�C� � rZc�F��t|t�sJ�t�|�
|�Sr�)r�r�r�r)r��visitorr�s  �rXrzColumnAdapter.chain9s"����'�=�1�1�1��w�}�W�%�%rZc��yr�r�)r�s rX�visitor_iteratorzColumnAdapter.visitor_iterator@s��?BrZc�R�|j|}||ur|j|d��y|S)NT)ror�)r�r�r�s   rX�adapt_check_presentz!ColumnAdapter.adapt_check_presentFs3�����c�"���S�=�T�7�7��T�B�J���
rZc�B�|jr+|jD]}|j|d��}|��n|}ntj	||�}|j
r|j
j
|�}|�|}|jr||ury||ur|j|_	|S)NT)r�)
�
_is_immutabler�r�rfr�r�r�r�r��_allow_label_resolve)r�r��visrs�c2s     rXr�zColumnAdapter._locate_colPs�������,�,���K�K��$�K�G���=��-�
���&�&�t�S�1�A��:�:����'�'��*�B��~������1��8��
�C�<�%)�%=�%=�A�"��rZ)NFNNFTFN)r�rFr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�)r�rIr�r�)r�zIterator[ColumnAdapter])r�rPr��Optional[ColumnElement[Any]])r�r�r�rr�r�rr�r�rr�rr�propertyr��adapt_clauserf�copy_and_process�
adapt_listr�r��
__classcell__)r�s@rXr�r��s#����<�I���
7;�$�@D�@D�$�$(�!&�DH����4���	�
>��>�
���"����!B��:
%�
%���7��7�
�,��,�!�2�!�	(�!�
&�
�	�B�
�B��L��/�/�J��%��	%��*�%�*�	%�*rZr�c�P�tjtj|||��S)z�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{�type_)r�expectr�LimitOffsetRole)r�r{r�s   rX�_offset_or_limit_clauser�}s&�����
���w�T���rZc�f�|�yt|d�r!|j}tj|�S|S)zdReturn the offset or limit clause as a simple integer if possible,
    else return the clause.

    N�_limit_offset_value)�hasattrr�r<�asint)r�r�s  rX�)_offset_or_limit_clause_asint_if_possibler��s6���~���v�,�-��*�*���z�z�%� � ��
rZc�"�|�D|�Bt|�}|�d}|dk7r||z}|dk(rd}n|�J�t|�}t||z
�}||fS|�|�t|�}||fS|�1|�/t|�}|�d}|dk7r||z}|dk(rd}||fSt|�}||fS)z0Compute LIMIT/OFFSET in terms of slice start/endNr)r�r�)�limit_clause�
offset_clause�start�stops    rX�_make_slicer��s��
��T�-�A��
�
�� ��M��A�:�)�E�1�M��A�� �M� �,�,�,�3�M�B�M�.�t�e�|�<��&��&�&�#
��4�+�.�t�4�� ��&�&�
�	�t�|�A��
�
�� ��M��A�:�)�E�1�M��A�� �M���&�&�4�M�B�M���&�&rZ)NN)
rVr3rWr3rS�Optional[FromClause]rTz(Optional[AbstractSet[ColumnClause[Any]]]r�zColumnElement[bool])r`zList[FromClause]rar3r��	List[int])r`�Sequence[FromClause]rmr3r�r)r`rrarDryr�r�r)r�zOCallable[[BinaryExpression[Any], ColumnElement[Any], ColumnElement[Any]], None]r�rPr�r�)r�r(r�r�r�r�r�r�r�r�r�r�r�zList[TableClause])r�rr�r)r�r3r�zIterator[FromClause])r�r3r�r3r�r�)rcrOr`zCollection[Any]r�rOr�)r�r�r�r�rhr�r�r�)rozIterable[ColumnElement[Any]]r`�Optional[ClauseElement]r�r�r�zSequence[ColumnElement[Any]])rorEr`rr�r�r�z/Sequence[Union[ColumnElement[Any], TextClause]])rorEr`rr�r�r�z1Collection[Union[ColumnElement[Any], TextClause]])NNF)r�r@r{z
Optional[str]r�z"Optional[_TypeEngineArgument[int]]r�zColumnElement[int])r�r@r�r@)
r�r@r�r@r�r�r�r�r�zATuple[Optional[ColumnElement[int]], Optional[ColumnElement[int]]])~r�
__future__r�collectionsrr��	itertoolsr�typingrrrr	r
rrr
rrrrrrrrrrrrr�_typingr�
annotationrrr�baser r!�	cache_keyr"�ddlr#r6r$r%r&r'r(r)r*r+r,r-r.r/r0�schemar1r�r2r3r4r5r6r7r8r9r;r<�util.typingr=r>r?r@rArBrCrDrErFrGrHrI�engine.interfacesrJrKrLrM�
engine.rowrNrOrYrgrpr}r�r�r�r�r�r�r�rkr�r�r�r�r�r�rrr�rr!rdrlrpr��ReplacingExternalTraversalrfr�r�r�r�r�r�rZrX�<module>rs!���#����
�������������� �������#�8�<�>� ��1�+�4�&�.�#�#�"�#��(��!��%���"�$��$�"�#����!�"�	���-�)�,�*�$�.�+�&�/�/�+�5�:�;�<� �
�e�/�0��&*�IM�	!��!��!�#�!�G�	!�
�!�H�
��(2����8)�
!�)�.8�)��)�X6�
!�6�
�6�+�6��	6�r?�	�?��	?�

�?�J �!��!��(��(��(��	(�
�(��
(��(��(�V,�^
?�K�"
� �'��&��
�&���2�
�
�
�"%�c�%�G�:�G�TH�<%)��
����"���	�:
�'�
)�'�%�'��'�"�	'�
�'�
�:�
�:�%�:��:�5�	:�
�:�Q'�
�Q'�%�Q'��Q'�7�	Q'�l"� $��	<�~q
�H�7�7�q
�h
0�H�
0� j�M�j�^�04�
�
�
�
�
�.�
��	
� 
��
��
� 2'�"�2'�#�2'��2'��	2'�
G�2'rZ


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
4 Apr 2025 8.03 AM
root / root
0755
__init__.cpython-312.pyc
4.557 KB
4 Apr 2025 8.03 AM
root / root
0644
_dml_constructors.cpython-312.pyc
3.881 KB
4 Apr 2025 8.03 AM
root / root
0644
_elements_constructors.cpython-312.pyc
64.02 KB
4 Apr 2025 8.03 AM
root / root
0644
_orm_types.cpython-312.pyc
0.592 KB
4 Apr 2025 8.03 AM
root / root
0644
_py_util.cpython-312.pyc
2.876 KB
4 Apr 2025 8.03 AM
root / root
0644
_selectable_constructors.cpython-312.pyc
22.733 KB
4 Apr 2025 8.03 AM
root / root
0644
_typing.cpython-312.pyc
14.533 KB
4 Apr 2025 8.03 AM
root / root
0644
annotation.cpython-312.pyc
20.818 KB
4 Apr 2025 8.03 AM
root / root
0644
base.cpython-312.pyc
95.578 KB
4 Apr 2025 8.03 AM
root / root
0644
cache_key.cpython-312.pyc
34.788 KB
4 Apr 2025 8.03 AM
root / root
0644
coercions.cpython-312.pyc
47.768 KB
4 Apr 2025 8.03 AM
root / root
0644
compiler.cpython-312.pyc
265.578 KB
4 Apr 2025 8.03 AM
root / root
0644
crud.cpython-312.pyc
44.384 KB
4 Apr 2025 8.03 AM
root / root
0644
ddl.cpython-312.pyc
56.464 KB
4 Apr 2025 8.03 AM
root / root
0644
default_comparator.cpython-312.pyc
19.006 KB
4 Apr 2025 8.03 AM
root / root
0644
dml.cpython-312.pyc
72.514 KB
4 Apr 2025 8.03 AM
root / root
0644
elements.cpython-312.pyc
206.643 KB
4 Apr 2025 8.03 AM
root / root
0644
events.cpython-312.pyc
18.751 KB
4 Apr 2025 8.03 AM
root / root
0644
expression.cpython-312.pyc
5.008 KB
4 Apr 2025 8.03 AM
root / root
0644
functions.cpython-312.pyc
73.986 KB
4 Apr 2025 8.03 AM
root / root
0644
lambdas.cpython-312.pyc
53.543 KB
4 Apr 2025 8.03 AM
root / root
0644
naming.cpython-312.pyc
8.245 KB
4 Apr 2025 8.03 AM
root / root
0644
operators.cpython-312.pyc
87.765 KB
4 Apr 2025 8.03 AM
root / root
0644
roles.cpython-312.pyc
11.938 KB
4 Apr 2025 8.03 AM
root / root
0644
schema.cpython-312.pyc
239.802 KB
4 Apr 2025 8.03 AM
root / root
0644
selectable.cpython-312.pyc
255.188 KB
4 Apr 2025 8.03 AM
root / root
0644
sqltypes.cpython-312.pyc
148.117 KB
4 Apr 2025 8.03 AM
root / root
0644
traversals.cpython-312.pyc
41.336 KB
4 Apr 2025 8.03 AM
root / root
0644
type_api.cpython-312.pyc
85.104 KB
4 Apr 2025 8.03 AM
root / root
0644
util.cpython-312.pyc
53.054 KB
4 Apr 2025 8.03 AM
root / root
0644
visitors.cpython-312.pyc
35.206 KB
4 Apr 2025 8.03 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF