관리-도구
편집 파일: tests.cpython-311.pyc
� �܋f � �6 � d Z ddlZddlZddlmZ ddlmZ ddlm Z ddl mZ ej rddl mZ d ed efd�Zd ed efd�Zd ed ed efd�Zd ej d efd�Zd ej d efd�Zeddd ed efd�� � Zeddd ed efd�� � Zd ej d efd�Zd ej d efd�Zd ej d efd�Zd ej d efd�Zd ej d efd�Zd ej d efd�Zd ed efd�Z d ed efd�Z!d ej d efd�Z"d ej d efd�Z#d ej d efd�Z$d ej d efd �Z%d ej d!ej d efd"�Z&d ej d efd#�Z'd ej d efd$�Z(d ej d%ej) d efd&�Z*i d'e�d(e�d)e�d*e�d+e�d,e�d-e�d.e�d/e�d0e�d1e�d2e�d3e�d4e �d5e!�d6e"�d7e#�i d8e$�d9e%�d:e'�d;e+�d<e&�d=e(�d>e*�d?ej, �d@ej, �dAej, �dBej- �dCej- �dDej. �dEej. �dFej. �dGej/ �dHej/ ��ej0 ej0 ej0 ej1 ej1 dI��Z2dS )Jz6Built-in template tests used with the ``is`` operator.� N)�abc)�Number� )� Undefined)�pass_environment)�Environment�value�returnc � � | dz dk S )z#Return true if the variable is odd.� r � �r s �C/opt/cloudlinux/venv/lib64/python3.11/site-packages/jinja2/tests.py�test_oddr � � ��1�9��>�� c � � | dz dk S )z$Return true if the variable is even.r r r r s r � test_evenr r r �numc � � | |z dk S )z-Check if a variable is divisible by a number.r r )r r s r �test_divisiblebyr s � ��3�;�!��r c �. � 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 r s r �test_definedr s � � �%��+�+�+�+r c �, � t | t � � S )z-Like :func:`defined` but the other way round.r r s r �test_undefinedr . s � ��e�Y�'�'�'r �envr c � � || j v S )a Check 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�r r s r �test_filterr"