3 sݨ\� � ! @ sF d Z ddlZddlZddlmZ ddlmZ ddlmZm Z m Z ddlZejd�Z ee �ZeZdd� Zd d � Zdd� Zd d� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Z d%d&� Z!eeeeeeeeeeeeeeee e!ej"ej"ej"ej#ej#ej$ej$ej$ej%ej%ej&ej&ej&ej'ej'd'� Z(dS )(z� jinja2.tests ~~~~~~~~~~~~ Jinja test functions. Used with the "is" operator. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. � N)�Mapping)� Undefined)� text_type�string_types� integer_typesz^-?\d+(\.\d+)?$c C s | d dkS )z#Return true if the variable is odd.� � � )�valuer r �/usr/lib/python3.6/tests.py�test_odd s r c C s | d dkS )z$Return true if the variable is even.r r r )r r r r � test_even s r c C s | | dkS )z-Check if a variable is divisible by a number.r r )r Znumr r r �test_divisibleby# s r c C s 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 r r r �test_defined( s r c C s t | t�S )z-Like :func:`defined` but the other way round.)r r )r r r r �test_undefined9 s r c C s | dkS )z$Return true if the variable is none.Nr )r r r r � test_none>