OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
jinja2
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:36:16 AM
rwxr-xr-x
📄
__init__.py
2.15 KB
11/09/2021 08:25:25 PM
rw-r--r--
📁
__pycache__
-
02/16/2024 08:52:04 PM
rwxr-xr-x
📄
_identifier.py
1.73 KB
02/17/2020 05:14:56 PM
rw-r--r--
📄
async_utils.py
1.9 KB
11/09/2021 05:17:58 PM
rw-r--r--
📄
bccache.py
12.37 KB
10/04/2021 08:41:58 PM
rw-r--r--
📄
compiler.py
70.52 KB
11/09/2021 04:37:43 PM
rw-r--r--
📄
constants.py
1.4 KB
04/05/2021 05:47:37 PM
rw-r--r--
📄
debug.py
8.29 KB
11/09/2021 05:17:58 PM
rw-r--r--
📄
defaults.py
1.24 KB
05/10/2021 01:52:40 PM
rw-r--r--
📄
environment.py
59.55 KB
11/09/2021 06:10:36 PM
rw-r--r--
📄
exceptions.py
4.95 KB
05/10/2021 01:52:40 PM
rw-r--r--
📄
ext.py
31.37 KB
05/14/2021 01:01:18 AM
rw-r--r--
📄
filters.py
51.38 KB
10/04/2021 08:41:58 PM
rw-r--r--
📄
idtracking.py
10.47 KB
08/10/2021 01:34:22 PM
rw-r--r--
📄
lexer.py
29.23 KB
10/04/2021 08:41:58 PM
rw-r--r--
📄
loaders.py
22.22 KB
11/09/2021 08:21:27 PM
rw-r--r--
📄
meta.py
4.29 KB
05/10/2021 01:52:40 PM
rw-r--r--
📄
nativetypes.py
3.88 KB
11/09/2021 05:17:58 PM
rw-r--r--
📄
nodes.py
33.74 KB
11/09/2021 05:18:01 PM
rw-r--r--
📄
optimizer.py
1.61 KB
05/10/2021 01:52:40 PM
rw-r--r--
📄
parser.py
38.83 KB
05/14/2021 01:01:13 AM
rw-r--r--
📄
py.typed
0 bytes
05/10/2021 01:52:40 PM
rw-r--r--
📄
runtime.py
34.23 KB
08/10/2021 01:34:22 PM
rw-r--r--
📄
sandbox.py
14.26 KB
05/10/2021 01:52:40 PM
rw-r--r--
📄
tests.py
5.77 KB
04/10/2021 05:20:38 PM
rw-r--r--
📄
utils.py
26.34 KB
10/04/2021 08:41:58 PM
rw-r--r--
📄
visitor.py
3.49 KB
05/10/2021 01:52:40 PM
rw-r--r--
Editing: async_utils.py
Close
import inspect import typing as t from functools import wraps from .utils import _PassArg from .utils import pass_eval_context V = t.TypeVar("V") def async_variant(normal_func): # type: ignore def decorator(async_func): # type: ignore pass_arg = _PassArg.from_obj(normal_func) need_eval_context = pass_arg is None if pass_arg is _PassArg.environment: def is_async(args: t.Any) -> bool: return t.cast(bool, args[0].is_async) else: def is_async(args: t.Any) -> bool: return t.cast(bool, args[0].environment.is_async) @wraps(normal_func) def wrapper(*args, **kwargs): # type: ignore b = is_async(args) if need_eval_context: args = args[1:] if b: return async_func(*args, **kwargs) return normal_func(*args, **kwargs) if need_eval_context: wrapper = pass_eval_context(wrapper) wrapper.jinja_async_variant = True return wrapper return decorator _common_primitives = {int, float, bool, str, list, dict, tuple, type(None)} async def auto_await(value: t.Union[t.Awaitable["V"], "V"]) -> "V": # Avoid a costly call to isawaitable if type(value) in _common_primitives: return t.cast("V", value) if inspect.isawaitable(value): return await t.cast("t.Awaitable[V]", value) return t.cast("V", value) async def auto_aiter( iterable: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", ) -> "t.AsyncIterator[V]": if hasattr(iterable, "__aiter__"): async for item in t.cast("t.AsyncIterable[V]", iterable): yield item else: for item in t.cast("t.Iterable[V]", iterable): yield item async def auto_to_list( value: "t.Union[t.AsyncIterable[V], t.Iterable[V]]", ) -> t.List["V"]: return [x async for x in auto_aiter(value)]