Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/jinja2/__pycache__/tests.cpython-37.pyc

B

f�q`�(@srdZddlZddlZddlmZddlmZddlm	Z	ddl
mZejrVddl
mZeed	�d
d�Zeed	�dd
�Zeeed�dd�Zejed	�dd�Zejed	�dd�Zedeed�dd��Zedeed�dd��Zejed	�dd�Zejed	�dd�Zejed	�dd �Zejed	�d!d"�Zejed	�d#d$�Zejed	�d%d&�Zeed	�d'd(�Z eed	�d)d*�Z!ejed	�d+d,�Z"ejed	�d-d.�Z#ejed	�d/d0�Z$ejed	�d1d2�Z%ejejed3�d4d5�Z&ejed	�d6d7�Z'ejed	�d8d9�Z(ejej)ed:�d;d<�Z*eeeeeeeeeeeeee e!e"e#e$e%e'e+e&e(e*ej,ej,ej,ej-ej-ej.ej.ej.ej/ej/ej0ej0ej0ej1ej1d=�'Z2dS)>z6Built-in template tests used with the ``is`` operator.�N)�abc)�Number�)�	Undefined)�pass_environment)�Environment)�value�returncCs|ddkS)z#Return true if the variable is odd.�r�)rrr�=/opt/alt/python37/lib/python3.7/site-packages/jinja2/tests.py�test_oddsr
cCs|ddkS)z$Return true if the variable is even.r
rr)rrrr�	test_evensr)r�numr	cCs||dkS)z-Check if a variable is divisible by a number.rr)rrrrr�test_divisiblebysrcCst|t�S)a;Return true if the variable is defined:

    .. sourcecode:: jinja

        {% if variable is defined %}
            value of variable: {{ variable }}
        {% else %}
            variable is not defined
        {% endif %}

    See the :func:`default` filter for a simple way to set undefined
    variables.
    )�
isinstancer)rrrr�test_definedsrcCs
t|t�S)z-Like :func:`defined` but the other way round.)rr)rrrr�test_undefined.srr)�envrr	cCs
||jkS)aCheck if a filter exists by name. Useful if a filter may be
    optionally available.

    .. code-block:: jinja

        {% if 'markdown' is filter %}
            {{ value | markdown }}
        {% else %}
            {{ value }}
        {% endif %}

    .. versionadded:: 3.0
    )�filters)rrrrr�test_filter3srcCs
||jkS)a�Check if a test exists by name. Useful if a test may be
    optionally available.

    .. code-block:: jinja

        {% if 'loud' is test %}
            {% if value is loud %}
                {{ value|upper }}
            {% else %}
                {{ value|lower }}
            {% endif %}
        {% else %}
            {{ value }}
        {% endif %}

    .. versionadded:: 3.0
    )�tests)rrrrr�	test_testEsrcCs|dkS)z$Return true if the variable is none.Nr)rrrr�	test_none[srcCs|dkp|dkS)zNReturn true if the object is a boolean value.

    .. versionadded:: 2.11
    TFr)rrrr�test_boolean`srcCs|dkS)zDReturn true if the object is False.

    .. versionadded:: 2.11
    Fr)rrrr�
test_falsehsrcCs|dkS)zCReturn true if the object is True.

    .. versionadded:: 2.11
    Tr)rrrr�	test_truepsrcCst|t�o|dk	o|dk	S)zIReturn true if the object is an integer.

    .. versionadded:: 2.11
    TF)r�int)rrrr�test_integerysrcCs
t|t�S)zFReturn true if the object is a float.

    .. versionadded:: 2.11
    )r�float)rrrr�
test_float�sr cCst|���S)z*Return true if the variable is lowercased.)�str�islower)rrrr�
test_lower�sr#cCst|���S)z*Return true if the variable is uppercased.)r!�isupper)rrrr�
test_upper�sr%cCs
t|t�S)z&Return true if the object is a string.)rr!)rrrr�test_string�sr&cCst|tj�S)zSReturn true if the object is a mapping (dict etc.).

    .. versionadded:: 2.6
    )rr�Mapping)rrrr�test_mapping�sr(cCs
t|t�S)z(Return true if the variable is a number.)rr)rrrr�test_number�sr)cCs,yt|�|jWntk
r&dSXdS)z^Return true if the variable is a sequence. Sequences are variables
    that are iterable.
    FT)�len�__getitem__�	Exception)rrrr�
test_sequence�s
r-)r�otherr	cCs||kS)z�Check if an object points to the same memory address than another
    object:

    .. sourcecode:: jinja

        {% if foo.attribute is sameas false %}
            the foo attribute really is the `False` singleton
        {% endif %}
    r)rr.rrr�test_sameas�s
r/cCs&yt|�Wntk
r dSXdS)z1Check if it's possible to iterate over an object.FT)�iter�	TypeError)rrrr�
test_iterable�s
r2cCs
t|d�S)zCheck if the value is escaped.Z__html__)�hasattr)rrrr�test_escaped�sr4)r�seqr	cCs||kS)z:Check if value is in seq.

    .. versionadded:: 2.10
    r)rr5rrr�test_in�sr6)'ZoddZevenZdivisibleby�definedZ	undefined�filter�testZnoneZboolean�false�true�integerr�lower�upper�string�mapping�number�sequence�iterable�callableZsameas�escaped�inz==�eqZequaltoz!=�ne�>�gtZgreaterthan�gez>=�<�ltZlessthanz<=�le)3�__doc__�operator�typing�t�collectionsr�numbersrZruntimer�utilsr�
TYPE_CHECKING�environmentrr�boolr
rr�Anyrrr!rrrrrrrr r#r%r&r(r)r-r/r2r4�	Containerr6rDrGrHrJrKrMrNZTESTSrrrr�<module>s�		


	

Hacked By AnonymousFox1.0, Coded By AnonymousFox