Dashboard
PHP:
8.1.34
OS:
Linux
User:
uid288609
/
/
usr
/
lib
/
python3
/
dist-packages
/
jinja2
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: utils.cpython-39.pyc
a ��h�W � @ s d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlm Z d dlm Z zd dlmZ W n ey� d dlmZ Y n0 d dlmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ eddddd� i�� Ze� ZdjZde � d�vZ!dd� Z"dd� Z#dd� Z$dd� Z%dd � Z&d!d"� Z'd#d$� Z(dJd&d'�Z)dKd)d*�Z*d+d,� Z+dLd-d.�Z,dMd/d0�Z-dNd5d6�Z.dOd8d9�Z/G d:d;� d;e0�Z1ej2�3e1� dPd=d>�Z4dQd?d@�Z5G dAdB� dBe0�Z6G dCdD� dDe0�Z7G dEdF� dFe0�Z8ze9dG� d2Z:W n e;�y d%Z:Y n0 dHdI� Z<dS )R� N)�choice)� randrange)� ascii_letters)�digits)�Lock)�deque��escape)�Markup� )�abc)�string_types)� text_type)� url_quoteZMissingType� �__repr__c C s dS )N�missingr )�xr r �./usr/lib/python3/dist-packages/jinja2/utils.py�<lambda> � r � z\/�/c C s d| _ | S )a+ This decorator can be used to mark a function or method context callable. A context callable is passed the active :class:`Context` as first argument when called from the template. This is useful if a function wants to get access to the context or functions provided on the context object. For example a function that returns a sorted list of template variables the current template exports could look like this:: @contextfunction def get_exported_names(context): return sorted(context.exported_vars) T)�contextfunction��fr r r r # s r c C s d| _ | S )aG This decorator can be used to mark a function or method as an eval context callable. This is similar to the :func:`contextfunction` but instead of passing the context, an evaluation context object is passed. For more information about the eval context, see :ref:`eval-context`. .. versionadded:: 2.4 T)�evalcontextfunctionr r r r r 3 s r c C s d| _ | S )z�This decorator can be used to mark a function or method as environment callable. This decorator works exactly like the :func:`contextfunction` decorator just that the first argument is the active :class:`Environment` and not context. T)�environmentfunctionr r r r r @ s r c C s t �| j� | S )z%Marks the function as internally used)� internal_code�add�__code__r r r r �internalcodeJ s r! c C s ddl m} t| |�S )a� Check if the object passed is undefined. This does nothing more than performing an instance check against :class:`Undefined` but looks nicer. This can be used for custom filters or tests that want to react to undefined variables. For example a custom default filter can look like this:: def default(var, default=''): if is_undefined(var): return default return var r )� Undefined)Zruntimer"