Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/sql/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/sqlalchemy/sql/__pycache__/operators.cpython-311.pyc

�

�܋f@����dZddlmZddlmZddlmZddlmZddlmZddlmZddlmZdd	lm	Z	dd
lm
Z
ddlmZddlmZdd
lm
Z
ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZejrddlmZneZGd�de��ZGd�de��ZGd�de��ZeeeehZeeeeee
hZd�Zd�Z d �Z!e d!���Z"d"�Z#d#�Z$d$�Z%d%�Z&e d&���Z'e d'���Z(e d(���Z)e d)���Z*d*�Z+d+�Z,e dcd-���Z-e dcd.���Z.e dcd/���Z/e dcd0���Z0e ddd2���Z1e ddd3���Z2e d4���Z3e d5���Z4d6�Z5d7�Z6d8�Z7d9�Z8e ded:���Z9e ded;���Z:e ded<���Z;e ded=���Z<e ded>���Z=e ded?���Z>e d@���Z?e dA���Z@dB�ZAe dC���ZBe dD���ZCdE�ZDdF�ZEdG�ZFdH�ZGdI�ZHdJ�ZIdK�ZJdL�ZKdM�ZLdN�ZMdO�ZNdP�ZOe	e%e&eefZPdQ�ZQeeee
eee
eiZRdR�ZSe�TeEeeg���Ueeg��ZVeV�TeeJeKg��ZW	ejXdSdT�U��ZYejXdVdW�U��ZZejXdXdY�U��Z[ie!dZ�e"dZ�e6dZ�e7dZ�edZ�eJdZ�eKdZ�ed[�ed[�ed[�e
d[�ed[�ed\�ed\�eEd]�eDd]�e?d^�ie@d^�e/d^�e0d^�e-d^�e.d^�e3d^�e4d^�e)d^�e*d^�ed^�ed^�e'd^�e(d^�eBd^�eCd^�ed^�ed^��ied^�e
d^�e1d^�e2d^�e5d^�e	d^�e%d^�e&d^�ed_�ed�eAd`�eFd_�eGd_�e+da�e#d`�e$d�eYdT��eZeZe[e[i�Z\db�Z]d,S)fz*Defines operators used in SQL expressions.�)�add)�and_)�contains)�eq)�ge)�getitem)�gt)�inv)�le)�lshift)�lt)�mod)�mul)�ne)�neg)�or_)�rshift)�sub)�truediv�)�util)�divc�F�eZdZdZdZd�Zd�Zd�Z	d
d	�Zdd
�Z	d�Z
d�ZdS)�	Operatorsa�Base of comparison and logical operators.

    Implements base methods
    :meth:`~sqlalchemy.sql.operators.Operators.operate` and
    :meth:`~sqlalchemy.sql.operators.Operators.reverse_operate`, as well as
    :meth:`~sqlalchemy.sql.operators.Operators.__and__`,
    :meth:`~sqlalchemy.sql.operators.Operators.__or__`,
    :meth:`~sqlalchemy.sql.operators.Operators.__invert__`.

    Usually is used via its most common subclass
    :class:`.ColumnOperators`.

    �c�8�|�t|��S)a-Implement the ``&`` operator.

        When used with SQL expressions, results in an
        AND operation, equivalent to
        :func:`_expression.and_`, that is::

            a & b

        is equivalent to::

            from sqlalchemy import and_
            and_(a, b)

        Care should be taken when using ``&`` regarding
        operator precedence; the ``&`` operator has the highest precedence.
        The operands should be enclosed in parenthesis if they contain
        further sub expressions::

            (a == 2) & (b == 4)

        )�operater��self�others  �O/opt/cloudlinux/venv/lib64/python3.11/site-packages/sqlalchemy/sql/operators.py�__and__zOperators.__and__;s��,�|�|�D�%�(�(�(�c�8�|�t|��S)a)Implement the ``|`` operator.

        When used with SQL expressions, results in an
        OR operation, equivalent to
        :func:`_expression.or_`, that is::

            a | b

        is equivalent to::

            from sqlalchemy import or_
            or_(a, b)

        Care should be taken when using ``|`` regarding
        operator precedence; the ``|`` operator has the highest precedence.
        The operands should be enclosed in parenthesis if they contain
        further sub expressions::

            (a == 2) | (b == 4)

        )rrrs  r!�__or__zOperators.__or__Ss��,�|�|�C��'�'�'r#c�6�|�t��S)aImplement the ``~`` operator.

        When used with SQL expressions, results in a
        NOT operation, equivalent to
        :func:`_expression.not_`, that is::

            ~a

        is equivalent to::

            from sqlalchemy import not_
            not_(a)

        )rr
�rs r!�
__invert__zOperators.__invert__ks���|�|�C� � � r#rFNc�:���t||||�����fd�}|S)a!Produce a generic operator function.

        e.g.::

          somecolumn.op("*")(5)

        produces::

          somecolumn * 5

        This function can also be used to make bitwise operators explicit. For
        example::

          somecolumn.op('&')(0xff)

        is a bitwise AND of the value in ``somecolumn``.

        :param operator: a string which will be output as the infix operator
          between this element and the expression passed to the
          generated function.

        :param precedence: precedence to apply to the operator, when
         parenthesizing expressions.  A lower number will cause the expression
         to be parenthesized when applied against another operator with
         higher precedence.  The default value of ``0`` is lower than all
         operators except for the comma (``,``) and ``AS`` operators.
         A value of 100 will be higher or equal to all operators, and -100
         will be lower than or equal to all operators.

        :param is_comparison: if True, the operator will be considered as a
         "comparison" operator, that is which evaluates to a boolean
         true/false value, like ``==``, ``>``, etc.  This flag should be set
         so that ORM relationships can establish that the operator is a
         comparison operator when used in a custom join condition.

         .. versionadded:: 0.9.2 - added the
            :paramref:`.Operators.op.is_comparison` flag.

        :param return_type: a :class:`.TypeEngine` class or object that will
          force the return type of an expression produced by this operator
          to be of that type.   By default, operators that specify
          :paramref:`.Operators.op.is_comparison` will resolve to
          :class:`.Boolean`, and those that do not will be of the same
          type as the left-hand operand.

          .. versionadded:: 1.2.0b3 - added the
             :paramref:`.Operators.op.return_type` argument.

        .. seealso::

            :ref:`types_operators`

            :ref:`relationship_custom_operator`

        c�����|��S�Nr)r �operatorrs ��r!�againstzOperators.op.<locals>.against�s����8�D�%�(�(�(r#)�	custom_op)r�opstring�
precedence�
is_comparison�return_typer-r,s`     @r!�opzOperators.op|s?����t�X�z�=�+�N�N��	)�	)�	)�	)�	)�	)��r#c�2�|�||d���S)a+Return a custom boolean operator.

        This method is shorthand for calling
        :meth:`.Operators.op` and passing the
        :paramref:`.Operators.op.is_comparison`
        flag with True.

        .. versionadded:: 1.2.0b3

        .. seealso::

            :meth:`.Operators.op`

        T)r0r1�r3)rr/r0s   r!�bool_opzOperators.bool_op�s���w�w�x�J�d�w�K�K�Kr#c�:�tt|�����)a3Operate on an argument.

        This is the lowest level of operation, raises
        :class:`NotImplementedError` by default.

        Overriding this on a subclass can allow common
        behavior to be applied to all operations.
        For example, overriding :class:`.ColumnOperators`
        to apply ``func.lower()`` to the left and right
        side::

            class MyComparator(ColumnOperators):
                def operate(self, op, other):
                    return op(func.lower(self), func.lower(other))

        :param op:  Operator callable.
        :param \*other: the 'other' side of the operation. Will
         be a single scalar for most operations.
        :param \**kwargs: modifiers.  These may be passed by special
         operators such as :meth:`ColumnOperators.contains`.


        ��NotImplementedError�str�rr3r �kwargss    r!rzOperators.operate�s��0"�#�b�'�'�*�*�*r#c�:�tt|�����)zXReverse operate on an argument.

        Usage is the same as :meth:`operate`.

        r8r;s    r!�reverse_operatezOperators.reverse_operate�s��"�#�b�'�'�*�*�*r#)rFN)r)�__name__�
__module__�__qualname__�__doc__�	__slots__r"r%r(r3r6rr>rr#r!rr*s����������I�)�)�)�0(�(�(�0!�!�!�$HL�?�?�?�?�BL�L�L�L�"+�+�+�4+�+�+�+�+r#rc�:�eZdZdZdZ					d	d�Zd�Zd�Zd�ZdS)
r.a�Represent a 'custom' operator.

    :class:`.custom_op` is normally instantiated when the
    :meth:`.Operators.op` or :meth:`.Operators.bool_op` methods
    are used to create a custom operator callable.  The class can also be
    used directly when programmatically constructing expressions.   E.g.
    to represent the "factorial" operation::

        from sqlalchemy.sql import UnaryExpression
        from sqlalchemy.sql import operators
        from sqlalchemy import Numeric

        unary = UnaryExpression(table.c.somecolumn,
                modifier=operators.custom_op("!"),
                type_=Numeric)


    .. seealso::

        :meth:`.Operators.op`

        :meth:`.Operators.bool_op`

    rFNc��||_||_||_||_||_|r|�|��nd|_dSr+)r/r0r1�natural_self_precedent�eager_grouping�_to_instancer2)rr/r0r1r2rFrGs       r!�__init__zcustom_op.__init__
sS��!��
�$���*���&<��#�,���5@�J�K�$�$�[�1�1�1�d�	
���r#c�L�t|t��o|j|jkSr+)�
isinstancer.r/rs  r!�__eq__zcustom_op.__eq__s ���%��+�+�O���$�-�0O�Or#c� �t|��Sr+)�idr's r!�__hash__zcustom_op.__hash__"s
���$�x�x�r#c� �|j||fi|��Sr+)r)r�left�right�kws    r!�__call__zcustom_op.__call__%s���t�|�D�%�.�.�2�.�.�.r#)rFNFF)r?r@rArBrIrLrOrTrr#r!r.r.�sz��������2�H�
���$��
�
�
�
�$P�P�P����/�/�/�/�/r#r.c�N�eZdZdZdZdZ	d�Zd�Zej	Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd4d�Zd4d�Zd�Zd�Zd4d�Zd4d�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d �Z$d!�Z%d"�Z&d#�Z'd$�Z(d%�Z)d&�Z*d'�Z+d5d)�Z,d*�Z-d+�Z.d,�Z/d-�Z0d.�Z1d/�Z2d0�Z3d1�Z4d2�Z5d3�Z6dS)6�ColumnOperatorsa"Defines boolean, comparison, and other operators for
    :class:`_expression.ColumnElement` expressions.

    By default, all methods call down to
    :meth:`.operate` or :meth:`.reverse_operate`,
    passing in the appropriate operator function from the
    Python builtin ``operator`` module or
    a SQLAlchemy-specific operator function from
    :mod:`sqlalchemy.expression.operators`.   For example
    the ``__eq__`` function::

        def __eq__(self, other):
            return self.operate(operators.eq, other)

    Where ``operators.eq`` is essentially::

        def eq(a, b):
            return a == b

    The core column expression unit :class:`_expression.ColumnElement`
    overrides :meth:`.Operators.operate` and others
    to return further :class:`_expression.ColumnElement` constructs,
    so that the ``==`` operation above is replaced by a clause
    construct.

    .. seealso::

        :ref:`types_operators`

        :attr:`.TypeEngine.comparator_factory`

        :class:`.ColumnOperators`

        :class:`.PropComparator`

    rNc�8�|�t|��S)zdImplement the ``<`` operator.

        In a column context, produces the clause ``a < b``.

        )rr
rs  r!�__lt__zColumnOperators.__lt__T����|�|�B��&�&�&r#c�8�|�t|��S)zfImplement the ``<=`` operator.

        In a column context, produces the clause ``a <= b``.

        )rrrs  r!�__le__zColumnOperators.__le__\rYr#c�8�|�t|��S)z�Implement the ``==`` operator.

        In a column context, produces the clause ``a = b``.
        If the target is ``None``, produces ``a IS NULL``.

        )rrrs  r!rLzColumnOperators.__eq__f����|�|�B��&�&�&r#c�8�|�t|��S)z�Implement the ``!=`` operator.

        In a column context, produces the clause ``a != b``.
        If the target is ``None``, produces ``a IS NOT NULL``.

        )rrrs  r!�__ne__zColumnOperators.__ne__or]r#c�8�|�t|��S)z�Implement the ``IS DISTINCT FROM`` operator.

        Renders "a IS DISTINCT FROM b" on most platforms;
        on some such as SQLite may render "a IS NOT b".

        .. versionadded:: 1.1

        )r�is_distinct_fromrs  r!raz ColumnOperators.is_distinct_fromxs���|�|�,�e�4�4�4r#c�8�|�t|��S)z�Implement the ``IS NOT DISTINCT FROM`` operator.

        Renders "a IS NOT DISTINCT FROM b" on most platforms;
        on some such as SQLite may render "a IS b".

        .. versionadded:: 1.1

        )r�isnot_distinct_fromrs  r!rcz#ColumnOperators.isnot_distinct_from�s���|�|�/��7�7�7r#c�8�|�t|��S)zdImplement the ``>`` operator.

        In a column context, produces the clause ``a > b``.

        )rr	rs  r!�__gt__zColumnOperators.__gt__�rYr#c�8�|�t|��S)zfImplement the ``>=`` operator.

        In a column context, produces the clause ``a >= b``.

        )rrrs  r!�__ge__zColumnOperators.__ge__�rYr#c�6�|�t��S)zaImplement the ``-`` operator.

        In a column context, produces the clause ``-a``.

        )rrr's r!�__neg__zColumnOperators.__neg__�s���|�|�C� � � r#c�8�|�t|��Sr+)rrrs  r!�__contains__zColumnOperators.__contains__�s���|�|�H�e�,�,�,r#c�8�|�t|��S)z�Implement the [] operator.

        This can be used by some database-specific types
        such as PostgreSQL ARRAY and HSTORE.

        )rr)r�indexs  r!�__getitem__zColumnOperators.__getitem__�s���|�|�G�U�+�+�+r#c�8�|�t|��S)z�implement the << operator.

        Not used by SQLAlchemy core, this is provided
        for custom operator systems which want to use
        << as an extension point.
        )rrrs  r!�
__lshift__zColumnOperators.__lshift__�����|�|�F�E�*�*�*r#c�8�|�t|��S)z�implement the >> operator.

        Not used by SQLAlchemy core, this is provided
        for custom operator systems which want to use
        >> as an extension point.
        )rrrs  r!�
__rshift__zColumnOperators.__rshift__�rqr#c�8�|�t|��S)z�Implement the 'concat' operator.

        In a column context, produces the clause ``a || b``,
        or uses the ``concat()`` operator on MySQL.

        )r�	concat_oprs  r!�concatzColumnOperators.concat�s���|�|�I�u�-�-�-r#c�<�|�t||���S)a�Implement the ``like`` operator.

        In a column context, produces the expression::

            a LIKE other

        E.g.::

            stmt = select([sometable]).\
                where(sometable.c.column.like("%foobar%"))

        :param other: expression to be compared
        :param escape: optional escape character, renders the ``ESCAPE``
          keyword, e.g.::

            somecolumn.like("foo/%bar", escape="/")

        .. seealso::

            :meth:`.ColumnOperators.ilike`

        ��escape)r�like_op�rr rys   r!�likezColumnOperators.like�s��.�|�|�G�U�6�|�:�:�:r#c�<�|�t||���S)a�Implement the ``ilike`` operator, e.g. case insensitive LIKE.

        In a column context, produces an expression either of the form::

            lower(a) LIKE lower(other)

        Or on backends that support the ILIKE operator::

            a ILIKE other

        E.g.::

            stmt = select([sometable]).\
                where(sometable.c.column.ilike("%foobar%"))

        :param other: expression to be compared
        :param escape: optional escape character, renders the ``ESCAPE``
          keyword, e.g.::

            somecolumn.ilike("foo/%bar", escape="/")

        .. seealso::

            :meth:`.ColumnOperators.like`

        rx)r�ilike_opr{s   r!�ilikezColumnOperators.ilike�s��6�|�|�H�e�F�|�;�;�;r#c�8�|�t|��S)a�Implement the ``in`` operator.

        In a column context, produces the clause ``column IN <other>``.

        The given parameter ``other`` may be:

        * A list of literal values, e.g.::

            stmt.where(column.in_([1, 2, 3]))

          In this calling form, the list of items is converted to a set of
          bound parameters the same length as the list given::

            WHERE COL IN (?, ?, ?)

        * A list of tuples may be provided if the comparison is against a
          :func:`.tuple_` containing multiple expressions::

            from sqlalchemy import tuple_
            stmt.where(tuple_(col1, col2).in_([(1, 10), (2, 20), (3, 30)]))

        * An empty list, e.g.::

            stmt.where(column.in_([]))

          In this calling form, the expression renders a "false" expression,
          e.g.::

            WHERE 1 != 1

          This "false" expression has historically had different behaviors
          in older SQLAlchemy versions, see
          :paramref:`_sa.create_engine.empty_in_strategy`
          for behavioral options.

          .. versionchanged:: 1.2 simplified the behavior of "empty in"
             expressions

        * A bound parameter, e.g. :func:`.bindparam`, may be used if it
          includes the :paramref:`.bindparam.expanding` flag::

            stmt.where(column.in_(bindparam('value', expanding=True)))

          In this calling form, the expression renders a special non-SQL
          placeholder expression that looks like::

            WHERE COL IN ([EXPANDING_value])

          This placeholder expression is intercepted at statement execution
          time to be converted into the variable number of bound parameter
          form illustrated earlier.   If the statement were executed as::

            connection.execute(stmt, {"value": [1, 2, 3]})

          The database would be passed a bound parameter for each value::

            WHERE COL IN (?, ?, ?)

          .. versionadded:: 1.2 added "expanding" bound parameters

          If an empty list is passed, a special "empty list" expression,
          which is specific to the database in use, is rendered.  On
          SQLite this would be::

            WHERE COL IN (SELECT 1 FROM (SELECT 1) WHERE 1!=1)

          .. versionadded:: 1.3 "expanding" bound parameters now support
             empty lists

        * a :func:`_expression.select` construct,
          which is usually a correlated
          scalar select::

            stmt.where(
                column.in_(
                    select([othertable.c.y]).
                    where(table.c.x == othertable.c.x)
                )
            )

          In this calling form, :meth:`.ColumnOperators.in_` renders as given::

            WHERE COL IN (SELECT othertable.y
            FROM othertable WHERE othertable.x = table.x)

        :param other: a list of literals, a :func:`_expression.select`
         construct,
         or a :func:`.bindparam` construct that includes the
         :paramref:`.bindparam.expanding` flag set to True.

        )r�in_oprs  r!�in_zColumnOperators.in_s��x�|�|�E�5�)�)�)r#c�8�|�t|��S)a�implement the ``NOT IN`` operator.

        This is equivalent to using negation with
        :meth:`.ColumnOperators.in_`, i.e. ``~x.in_(y)``.

        In the case that ``other`` is an empty sequence, the compiler
        produces an "empty not in" expression.   This defaults to the
        expression "1 = 1" to produce true in all cases.  The
        :paramref:`_sa.create_engine.empty_in_strategy` may be used to
        alter this behavior.

        .. versionchanged:: 1.2  The :meth:`.ColumnOperators.in_` and
           :meth:`.ColumnOperators.notin_` operators
           now produce a "static" expression for an empty IN sequence
           by default.

        .. seealso::

            :meth:`.ColumnOperators.in_`

        )r�notin_oprs  r!�notin_zColumnOperators.notin_as��,�|�|�H�e�,�,�,r#c�<�|�t||���S)z�implement the ``NOT LIKE`` operator.

        This is equivalent to using negation with
        :meth:`.ColumnOperators.like`, i.e. ``~x.like(y)``.

        .. seealso::

            :meth:`.ColumnOperators.like`

        rx)r�
notlike_opr{s   r!�notlikezColumnOperators.notlikeys���|�|�J��f�|�=�=�=r#c�<�|�t||���S)z�implement the ``NOT ILIKE`` operator.

        This is equivalent to using negation with
        :meth:`.ColumnOperators.ilike`, i.e. ``~x.ilike(y)``.

        .. seealso::

            :meth:`.ColumnOperators.ilike`

        rx)r�notilike_opr{s   r!�notilikezColumnOperators.notilike�s���|�|�K��v�|�>�>�>r#c�8�|�t|��S)aVImplement the ``IS`` operator.

        Normally, ``IS`` is generated automatically when comparing to a
        value of ``None``, which resolves to ``NULL``.  However, explicit
        usage of ``IS`` may be desirable if comparing to boolean values
        on certain platforms.

        .. seealso:: :meth:`.ColumnOperators.isnot`

        )r�is_rs  r!r�zColumnOperators.is_�s���|�|�C��'�'�'r#c�8�|�t|��S)a`Implement the ``IS NOT`` operator.

        Normally, ``IS NOT`` is generated automatically when comparing to a
        value of ``None``, which resolves to ``NULL``.  However, explicit
        usage of ``IS NOT`` may be desirable if comparing to boolean values
        on certain platforms.

        .. seealso:: :meth:`.ColumnOperators.is_`

        )r�isnotrs  r!r�zColumnOperators.isnot�s���|�|�E�5�)�)�)r#c�*�|jt|fi|��S)a�Implement the ``startswith`` operator.

        Produces a LIKE expression that tests against a match for the start
        of a string value::

            column LIKE <other> || '%'

        E.g.::

            stmt = select([sometable]).\
                where(sometable.c.column.startswith("foobar"))

        Since the operator uses ``LIKE``, wildcard characters
        ``"%"`` and ``"_"`` that are present inside the <other> expression
        will behave like wildcards as well.   For literal string
        values, the :paramref:`.ColumnOperators.startswith.autoescape` flag
        may be set to ``True`` to apply escaping to occurrences of these
        characters within the string value so that they match as themselves
        and not as wildcard characters.  Alternatively, the
        :paramref:`.ColumnOperators.startswith.escape` parameter will establish
        a given character as an escape character which can be of use when
        the target expression is not a literal string.

        :param other: expression to be compared.   This is usually a plain
          string value, but can also be an arbitrary SQL expression.  LIKE
          wildcard characters ``%`` and ``_`` are not escaped by default unless
          the :paramref:`.ColumnOperators.startswith.autoescape` flag is
          set to True.

        :param autoescape: boolean; when True, establishes an escape character
          within the LIKE expression, then applies it to all occurrences of
          ``"%"``, ``"_"`` and the escape character itself within the
          comparison value, which is assumed to be a literal string and not a
          SQL expression.

          An expression such as::

            somecolumn.startswith("foo%bar", autoescape=True)

          Will render as::

            somecolumn LIKE :param || '%' ESCAPE '/'

          With the value of ``:param`` as ``"foo/%bar"``.

          .. versionadded:: 1.2

          .. versionchanged:: 1.2.0 The
            :paramref:`.ColumnOperators.startswith.autoescape` parameter is
             now a simple boolean rather than a character; the escape
             character itself is also escaped, and defaults to a forwards
             slash, which itself can be customized using the
             :paramref:`.ColumnOperators.startswith.escape` parameter.

        :param escape: a character which when given will render with the
          ``ESCAPE`` keyword to establish that character as the escape
          character.  This character can then be placed preceding occurrences
          of ``%`` and ``_`` to allow them to act as themselves and not
          wildcard characters.

          An expression such as::

            somecolumn.startswith("foo/%bar", escape="^")

          Will render as::

            somecolumn LIKE :param || '%' ESCAPE '^'

          The parameter may also be combined with
          :paramref:`.ColumnOperators.startswith.autoescape`::

            somecolumn.startswith("foo%bar^bat", escape="^", autoescape=True)

          Where above, the given literal parameter will be converted to
          ``"foo^%bar^^bat"`` before being passed to the database.

        .. seealso::

            :meth:`.ColumnOperators.endswith`

            :meth:`.ColumnOperators.contains`

            :meth:`.ColumnOperators.like`

        )r�
startswith_op�rr r<s   r!�
startswithzColumnOperators.startswith�s!��l�t�|�M�5�;�;�F�;�;�;r#c�*�|jt|fi|��S)a�Implement the 'endswith' operator.

        Produces a LIKE expression that tests against a match for the end
        of a string value::

            column LIKE '%' || <other>

        E.g.::

            stmt = select([sometable]).\
                where(sometable.c.column.endswith("foobar"))

        Since the operator uses ``LIKE``, wildcard characters
        ``"%"`` and ``"_"`` that are present inside the <other> expression
        will behave like wildcards as well.   For literal string
        values, the :paramref:`.ColumnOperators.endswith.autoescape` flag
        may be set to ``True`` to apply escaping to occurrences of these
        characters within the string value so that they match as themselves
        and not as wildcard characters.  Alternatively, the
        :paramref:`.ColumnOperators.endswith.escape` parameter will establish
        a given character as an escape character which can be of use when
        the target expression is not a literal string.

        :param other: expression to be compared.   This is usually a plain
          string value, but can also be an arbitrary SQL expression.  LIKE
          wildcard characters ``%`` and ``_`` are not escaped by default unless
          the :paramref:`.ColumnOperators.endswith.autoescape` flag is
          set to True.

        :param autoescape: boolean; when True, establishes an escape character
          within the LIKE expression, then applies it to all occurrences of
          ``"%"``, ``"_"`` and the escape character itself within the
          comparison value, which is assumed to be a literal string and not a
          SQL expression.

          An expression such as::

            somecolumn.endswith("foo%bar", autoescape=True)

          Will render as::

            somecolumn LIKE '%' || :param ESCAPE '/'

          With the value of ``:param`` as ``"foo/%bar"``.

          .. versionadded:: 1.2

          .. versionchanged:: 1.2.0 The
            :paramref:`.ColumnOperators.endswith.autoescape` parameter is
             now a simple boolean rather than a character; the escape
             character itself is also escaped, and defaults to a forwards
             slash, which itself can be customized using the
             :paramref:`.ColumnOperators.endswith.escape` parameter.

        :param escape: a character which when given will render with the
          ``ESCAPE`` keyword to establish that character as the escape
          character.  This character can then be placed preceding occurrences
          of ``%`` and ``_`` to allow them to act as themselves and not
          wildcard characters.

          An expression such as::

            somecolumn.endswith("foo/%bar", escape="^")

          Will render as::

            somecolumn LIKE '%' || :param ESCAPE '^'

          The parameter may also be combined with
          :paramref:`.ColumnOperators.endswith.autoescape`::

            somecolumn.endswith("foo%bar^bat", escape="^", autoescape=True)

          Where above, the given literal parameter will be converted to
          ``"foo^%bar^^bat"`` before being passed to the database.

        .. seealso::

            :meth:`.ColumnOperators.startswith`

            :meth:`.ColumnOperators.contains`

            :meth:`.ColumnOperators.like`

        )r�endswith_opr�s   r!�endswithzColumnOperators.endswiths!��l�t�|�K��9�9�&�9�9�9r#c�*�|jt|fi|��S)a
Implement the 'contains' operator.

        Produces a LIKE expression that tests against a match for the middle
        of a string value::

            column LIKE '%' || <other> || '%'

        E.g.::

            stmt = select([sometable]).\
                where(sometable.c.column.contains("foobar"))

        Since the operator uses ``LIKE``, wildcard characters
        ``"%"`` and ``"_"`` that are present inside the <other> expression
        will behave like wildcards as well.   For literal string
        values, the :paramref:`.ColumnOperators.contains.autoescape` flag
        may be set to ``True`` to apply escaping to occurrences of these
        characters within the string value so that they match as themselves
        and not as wildcard characters.  Alternatively, the
        :paramref:`.ColumnOperators.contains.escape` parameter will establish
        a given character as an escape character which can be of use when
        the target expression is not a literal string.

        :param other: expression to be compared.   This is usually a plain
          string value, but can also be an arbitrary SQL expression.  LIKE
          wildcard characters ``%`` and ``_`` are not escaped by default unless
          the :paramref:`.ColumnOperators.contains.autoescape` flag is
          set to True.

        :param autoescape: boolean; when True, establishes an escape character
          within the LIKE expression, then applies it to all occurrences of
          ``"%"``, ``"_"`` and the escape character itself within the
          comparison value, which is assumed to be a literal string and not a
          SQL expression.

          An expression such as::

            somecolumn.contains("foo%bar", autoescape=True)

          Will render as::

            somecolumn LIKE '%' || :param || '%' ESCAPE '/'

          With the value of ``:param`` as ``"foo/%bar"``.

          .. versionadded:: 1.2

          .. versionchanged:: 1.2.0 The
            :paramref:`.ColumnOperators.contains.autoescape` parameter is
             now a simple boolean rather than a character; the escape
             character itself is also escaped, and defaults to a forwards
             slash, which itself can be customized using the
             :paramref:`.ColumnOperators.contains.escape` parameter.

        :param escape: a character which when given will render with the
          ``ESCAPE`` keyword to establish that character as the escape
          character.  This character can then be placed preceding occurrences
          of ``%`` and ``_`` to allow them to act as themselves and not
          wildcard characters.

          An expression such as::

            somecolumn.contains("foo/%bar", escape="^")

          Will render as::

            somecolumn LIKE '%' || :param || '%' ESCAPE '^'

          The parameter may also be combined with
          :paramref:`.ColumnOperators.contains.autoescape`::

            somecolumn.contains("foo%bar^bat", escape="^", autoescape=True)

          Where above, the given literal parameter will be converted to
          ``"foo^%bar^^bat"`` before being passed to the database.

        .. seealso::

            :meth:`.ColumnOperators.startswith`

            :meth:`.ColumnOperators.endswith`

            :meth:`.ColumnOperators.like`


        )r�contains_opr�s   r!rzColumnOperators.contains]s!��n�t�|�K��9�9�&�9�9�9r#c�*�|jt|fi|��S)aYImplements a database-specific 'match' operator.

        :meth:`~.ColumnOperators.match` attempts to resolve to
        a MATCH-like function or operator provided by the backend.
        Examples include:

        * PostgreSQL - renders ``x @@ to_tsquery(y)``
        * MySQL - renders ``MATCH (x) AGAINST (y IN BOOLEAN MODE)``
        * Oracle - renders ``CONTAINS(x, y)``
        * other backends may provide special implementations.
        * Backends without any special implementation will emit
          the operator as "MATCH".  This is compatible with SQLite, for
          example.

        )r�match_opr�s   r!�matchzColumnOperators.match�s �� �t�|�H�e�6�6�v�6�6�6r#c�6�|�t��S)zLProduce a :func:`_expression.desc` clause against the
        parent object.)r�desc_opr's r!�desczColumnOperators.desc�s���|�|�G�$�$�$r#c�6�|�t��S)zKProduce a :func:`_expression.asc` clause against the
        parent object.)r�asc_opr's r!�asczColumnOperators.asc�s���|�|�F�#�#�#r#c�6�|�t��S)zRProduce a :func:`_expression.nullsfirst` clause against the
        parent object.)r�
nullsfirst_opr's r!�
nullsfirstzColumnOperators.nullsfirst�s���|�|�M�*�*�*r#c�6�|�t��S)zQProduce a :func:`_expression.nullslast` clause against the
        parent object.)r�nullslast_opr's r!�	nullslastzColumnOperators.nullslast�s���|�|�L�)�)�)r#c�8�|�t|��S)z�Produce a :func:`_expression.collate` clause against
        the parent object, given the collation string.

        .. seealso::

            :func:`_expression.collate`

        )r�collate)r�	collations  r!r�zColumnOperators.collate�s���|�|�G�Y�/�/�/r#c�8�|�t|��S)zaImplement the ``+`` operator in reverse.

        See :meth:`.ColumnOperators.__add__`.

        )r>rrs  r!�__radd__zColumnOperators.__radd__�����#�#�C��/�/�/r#c�8�|�t|��S)zaImplement the ``-`` operator in reverse.

        See :meth:`.ColumnOperators.__sub__`.

        )r>rrs  r!�__rsub__zColumnOperators.__rsub__�r�r#c�8�|�t|��S)zaImplement the ``*`` operator in reverse.

        See :meth:`.ColumnOperators.__mul__`.

        )r>rrs  r!�__rmul__zColumnOperators.__rmul__�r�r#c�8�|�t|��S)zaImplement the ``/`` operator in reverse.

        See :meth:`.ColumnOperators.__div__`.

        )r>rrs  r!�__rdiv__zColumnOperators.__rdiv__�r�r#c�8�|�t|��S)zaImplement the ``%`` operator in reverse.

        See :meth:`.ColumnOperators.__mod__`.

        )r>rrs  r!�__rmod__zColumnOperators.__rmod__r�r#Fc�>�|�t|||���S)zzProduce a :func:`_expression.between` clause against
        the parent object, given the lower and upper range.

        ��	symmetric)r�
between_op)r�cleft�crightr�s    r!�betweenzColumnOperators.betweens��
�|�|�J��v��|�K�K�Kr#c�6�|�t��S)zZProduce a :func:`_expression.distinct` clause against the
        parent object.

        )r�distinct_opr's r!�distinctzColumnOperators.distincts��
�|�|�K�(�(�(r#c�6�|�t��S)a�Produce a :func:`_expression.any_` clause against the
        parent object.

        This operator is only appropriate against a scalar subquery
        object, or for some backends an column expression that is
        against the ARRAY type, e.g.::

            # postgresql '5 = ANY (somearray)'
            expr = 5 == mytable.c.somearray.any_()

            # mysql '5 = ANY (SELECT value FROM table)'
            expr = 5 == select([table.c.value]).as_scalar().any_()

        .. seealso::

            :func:`_expression.any_` - standalone version

            :func:`_expression.all_` - ALL operator

        .. versionadded:: 1.1

        )r�any_opr's r!�any_zColumnOperators.any_���.�|�|�F�#�#�#r#c�6�|�t��S)a�Produce a :func:`_expression.all_` clause against the
        parent object.

        This operator is only appropriate against a scalar subquery
        object, or for some backends an column expression that is
        against the ARRAY type, e.g.::

            # postgresql '5 = ALL (somearray)'
            expr = 5 == mytable.c.somearray.all_()

            # mysql '5 = ALL (SELECT value FROM table)'
            expr = 5 == select([table.c.value]).as_scalar().all_()

        .. seealso::

            :func:`_expression.all_` - standalone version

            :func:`_expression.any_` - ANY operator

        .. versionadded:: 1.1

        )r�all_opr's r!�all_zColumnOperators.all_6r�r#c�8�|�t|��S)a4Implement the ``+`` operator.

        In a column context, produces the clause ``a + b``
        if the parent object has non-string affinity.
        If the parent object has a string affinity,
        produces the concatenation operator, ``a || b`` -
        see :meth:`.ColumnOperators.concat`.

        )rrrs  r!�__add__zColumnOperators.__add__Os���|�|�C��'�'�'r#c�8�|�t|��S)zdImplement the ``-`` operator.

        In a column context, produces the clause ``a - b``.

        )rrrs  r!�__sub__zColumnOperators.__sub__[����|�|�C��'�'�'r#c�8�|�t|��S)zdImplement the ``*`` operator.

        In a column context, produces the clause ``a * b``.

        )rrrs  r!�__mul__zColumnOperators.__mul__cr�r#c�8�|�t|��S)zdImplement the ``/`` operator.

        In a column context, produces the clause ``a / b``.

        )rrrs  r!�__div__zColumnOperators.__div__kr�r#c�8�|�t|��S)zdImplement the ``%`` operator.

        In a column context, produces the clause ``a % b``.

        )rrrs  r!�__mod__zColumnOperators.__mod__sr�r#c�8�|�t|��S)zeImplement the ``//`` operator.

        In a column context, produces the clause ``a / b``.

        )rrrs  r!�__truediv__zColumnOperators.__truediv__{s���|�|�G�U�+�+�+r#c�8�|�t|��S)zfImplement the ``//`` operator in reverse.

        See :meth:`.ColumnOperators.__truediv__`.

        )r>rrs  r!�__rtruediv__zColumnOperators.__rtruediv__�s���#�#�G�U�3�3�3r#r+�F)7r?r@rArBrC�	timetuplerXr[rrOrLr_rarcrergrirkrnrprsrvr|rr�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr#r!rVrV)s&������#�#�J�I��I�B�'�'�'�'�'�'��!�H�'�'�'�'�'�'�	5�	5�	5�	8�	8�	8�'�'�'�'�'�'�!�!�!�-�-�-�,�,�,�+�+�+�+�+�+�.�.�.�;�;�;�;�2<�<�<�<�:\*�\*�\*�|-�-�-�0>�>�>�>�?�?�?�?�(�(�(�*�*�*�V<�V<�V<�pV:�V:�V:�pW:�W:�W:�r7�7�7�$%�%�%�
$�$�$�
+�+�+�
*�*�*�
	0�	0�	0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�L�L�L�L�)�)�)�$�$�$�2$�$�$�2
(�
(�
(�(�(�(�(�(�(�(�(�(�(�(�(�,�,�,�4�4�4�4�4r#rVc�:�t�|��|Sr+)�_commutativer��fns r!�commutative_opr��s�����R����
�Ir#c�:�t�|��|Sr+)�_comparisonrr�s r!�
comparison_opr��s���O�O�B����
�Ir#c��t���r+�r9rr#r!�from_r�����
�
�
�r#c��t���r+r�rr#r!�function_as_comparison_opr�����
�
�
�r#c��t���r+r�rr#r!�as_r��r�r#c��t���r+r�rr#r!�existsr��r�r#c��t���r+r���as r!�istruer��r�r#c��t���r+r�r�s r!�isfalser��r�r#c�,�|�|��Sr+)ra�r��bs  r!rara�s�����a� � � r#c�,�|�|��Sr+)rcr�s  r!rcrc�s��� � ��#�#�#r#c�,�|�|��Sr+)r�r�s  r!r�r������5�5��8�8�Or#c�,�|�|��Sr+)r�r�s  r!r�r��s���7�7�1�:�:�r#c�,�|�|��Sr+)r�r�s  r!r�r��s���9�9�Q�<�<�r#c�>�|�|��|��Sr+r5)r�r/r�s   r!r3r3�s���1�4�4��>�>�!���r#Nc�0�|�||���S�Nrx)r|�r�r�rys   r!rzrz�s���6�6�!�F�6�#�#�#r#c�0�|�||���Sr�)r�r�s   r!r�r��s���9�9�Q�v�9�&�&�&r#c�0�|�||���Sr�)rr�s   r!r~r~�s���7�7�1�V�7�$�$�$r#c�0�|�||���Sr�)r�r�s   r!r�r��s���:�:�a��:�'�'�'r#Fc�2�|�|||���S�Nr�)r��r�r��cr�s    r!r�r��s���9�9�Q��Y�9�/�/�/r#c�2�|�|||���Sr)�
notbetweenrs    r!�
notbetween_opr�s���<�<��1�	�<�2�2�2r#c�,�|�|��Sr+)r�r�s  r!r�r��r�r#c�,�|�|��Sr+)r�r�s  r!r�r��s���8�8�A�;�;�r#c�*�|���Sr+)r�r�s r!r�r��s���:�:�<�<�r#c�*�|���Sr+)r�r�s r!r�r������6�6�8�8�Or#c�*�|���Sr+)r�r�s r!r�r��rr#c�N�|r�|durtjd��|�d}t|tjj��std���|dvr|�|||z��}|�d|dz���d|dz��}|||���S)	NTz;The autoescape parameter is now a simple boolean True/False�/z*String value expected when autoescape=True)�%�_rrrx)r�warnrK�compat�string_types�	TypeError�replace)r�r ry�
autoescapes    r!�_escaped_like_implrs����L��T�!�!��I�M�
�
�
��>��F��%���!9�:�:�	J��H�I�I�I���#�#��M�M�&�&�6�/�:�:�E��
�
�c�6�C�<�0�0�8�8��f�s�l�K�K��
�2�e�F�#�#�#�#r#c�0�t|j|||��Sr+�rr��r�r�ryrs    r!r�r�s���a�l�A�v�z�B�B�Br#c�2�t|j|||��Sr+rrs    r!�notstartswith_oprs���q�|�Q��
�C�C�C�Cr#c�0�t|j|||��Sr+�rr�rs    r!r�r�!����a�j�!�V�Z�@�@�@r#c�2�t|j|||��Sr+rrs    r!�notendswith_opr!&����q�z�1�f�j�A�A�A�Ar#c�0�t|j|||��Sr+�rrrs    r!r�r�+rr#c�2�t|j|||��Sr+r$rs    r!�notcontains_opr&0r"r#c��|j|fi|��Sr+)r��r�r�rSs   r!r�r�5s���1�7�1������r#c��|j|fi|��Sr+)�notmatchr(s   r!�notmatch_opr+:s���1�:�a���2���r#c��t���r+r�r�s  r!�comma_opr-?r�r#c��t���r+r�r�s  r!�empty_in_opr/Cr�r#c��t���r+r�r�s  r!�empty_notin_opr1Hr�r#c��t���r+r�r�s  r!�	filter_opr3Mr�r#c�,�|�|��Sr+)rvr�s  r!ruruQs���8�8�A�;�;�r#c�*�|���Sr+)r�r�s r!r�r�Urr#c�*�|���Sr+)r�r�s r!r�r�Ys���5�5�7�7�Nr#c�*�|���Sr+)r�r�s r!r�r�]s���<�<�>�>�r#c�*�|���Sr+)r�r�s r!r�r�as���;�;�=�=�r#c��t���r+r�r�s  r!�json_getitem_opr:er�r#c��t���r+r�r�s  r!�json_path_getitem_opr<ir�r#c�L�|tvpt|t��o|jSr+)r�rKr.r1r5s r!r1r1ms$��
���N�
�2�y� 9� 9� N�b�>N�Nr#c��|tvSr+)r�r5s r!�is_commutativer?qs
��
���r#c�:�|ttttfvSr+)r�r�r�r�r5s r!�is_ordering_modifierrAus��
�&�'�=�,�?�?�?r#c�L�|tvpt|t��o|jSr+)�_natural_self_precedentrKr.rFr5s r!�is_natural_self_precedentrDys-��
�%�%�	&��b�)�$�$�&��%�r#c�2�t|��p|tvSr+)r1�	_booleansr5s r!�
is_booleanrG�s������/��i��/r#c�8�t�||��S)z[rotate a comparison operator 180 degrees.

    Note this is not the same as negation.

    )�_mirror�getr5s r!�mirrorrK�s���;�;�r�2���r#�_asbooli����)�	canonical�	_smallesti�����_largest�d����������c	���||urt|��rdSt�|t|dt����t�|t|dt
����kS)NFr0)rD�_PRECEDENCErJ�getattrrNrO)r,r-s  r!�is_precedentr\�sk���7���8��B�B���u�����g�h��i�@�@�
�
�
�_�_�W�g�g�|�X�&N�&N�
O�
O�P�	Pr#r+r�)NF)^rBr,rrrrrrr	r
rrr
rrrrrrrr�r�py2kr�objectrr.rVr�r�r�r�r�r�r�r�r�r�rarcr�r�r�r3rzr�r~r�r�rr�r�r�r�r�rr�rr�r!r�r&r�r+r-r/r1r3rur�r�r�r�r:r<r1r?rArDrFrGrIrK�union�
difference�_associativerC�symbolrLrNrOrZr\rr#r!�<module>rdsU
��1�0��������������������������������������������������������������������������������������������������������������������������9���������
�C�D+�D+�D+�D+�D+��D+�D+�D+�N5/�5/�5/�5/�5/��5/�5/�5/�p`
4�`
4�`
4�`
4�`
4�i�`
4�`
4�`
4�F�B��S�!���2�r�2�r�2�&�����
���
 � � �� � ��� � � � � � � � � � � � � ��!�!���!��$�$���$��������������������$�$�$���$��'�'�'���'��%�%�%���%��(�(�(���(��0�0�0���0��3�3�3���3����������������������$�$�$�(�C�C�C���C��D�D�D���D��A�A�A���A��B�B�B���B��A�A�A���A��B�B�B���B������������� � � �� � ��� �� � ��� � � � ���������������� � � � � � �O�O�O����@�@�@�����&�'�4��-�	�0�0�0��r�2�r�2�r�2�r�
*������!�!�9�d�C�"8�9�9�D�D�b�"�X�N�N��&�,�,��o�3�4������$�+�i�3�
/�
/�
/���D�K��t�4�4�4�	��4�;�z�S�1�1�1��6�	�2�6��r�6��B�6��B�	6�
�R�6��R�
6��"�6���6��Q�6���6���6���6���6���6��q�6� �q�!6�"
�a�#6�6�$��%6�&
�a�'6�(��)6�*�Q�+6�,��-6�.
�1�/6�0
�a�16�2��36�4
�1�56�6��76�8��96�:�a�;6�<��=6�>��?6�@�A�A6�B��C6�D��E6�6�6�F��G6�H��I6�J��K6�L�1�M6�N��O6�P��Q6�R�A�S6�T�Q�U6�V	�!�W6�X��Y6�Z
�b�[6�\�Q�]6�^�A�_6�`�Q�a6�b��c6�d�A�e6�f�S�g6�6�h�y��h�k6�6��rP�P�P�P�Pr#

Hacked By AnonymousFox1.0, Coded By AnonymousFox