GRAYBYTE WORDPRESS FILE MANAGER5850

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/imunify360/venv/lib/python3.11/site-packages/jinja2/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/imunify360/venv/lib/python3.11/site-packages/jinja2//optimizer.py
# -*- coding: utf-8 -*-
"""The optimizer tries to constant fold expressions and modify the AST
in place so that it should be faster to evaluate.

Because the AST does not contain all the scoping information and the
compiler has to find that out, we cannot do all the optimizations we
want. For example, loop unrolling doesn't work because unrolled loops
would have a different scope. The solution would be a second syntax tree
that stored the scoping rules.
"""
from . import nodes
from .visitor import NodeTransformer


def optimize(node, environment):
    """The context hint can be used to perform an static optimization
    based on the context given."""
    optimizer = Optimizer(environment)
    return optimizer.visit(node)


class Optimizer(NodeTransformer):
    def __init__(self, environment):
        self.environment = environment

    def generic_visit(self, node, *args, **kwargs):
        node = super(Optimizer, self).generic_visit(node, *args, **kwargs)

        # Do constant folding. Some other nodes besides Expr have
        # as_const, but folding them causes errors later on.
        if isinstance(node, nodes.Expr):
            try:
                return nodes.Const.from_untrusted(
                    node.as_const(args[0] if args else None),
                    lineno=node.lineno,
                    environment=self.environment,
                )
            except nodes.Impossible:
                pass

        return node

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 11 2025 07:53:06
root / root
0755
__pycache__
--
July 02 2025 08:36:55
root / root
0755
__init__.py
1.513 KB
June 09 2025 11:12:39
root / root
0644
_compat.py
3.116 KB
June 09 2025 11:12:39
root / root
0644
_identifier.py
1.733 KB
June 09 2025 11:12:39
root / root
0644
asyncfilters.py
4.15 KB
June 09 2025 11:12:39
root / root
0644
asyncsupport.py
7.04 KB
June 09 2025 11:12:39
root / root
0644
bccache.py
11.854 KB
June 09 2025 11:12:39
root / root
0644
compiler.py
64.73 KB
June 09 2025 11:12:39
root / root
0644
constants.py
1.424 KB
June 09 2025 11:12:39
root / root
0644
debug.py
8.329 KB
June 09 2025 11:12:39
root / root
0644
defaults.py
1.1 KB
June 09 2025 11:12:39
root / root
0644
environment.py
49.442 KB
June 09 2025 11:12:39
root / root
0644
exceptions.py
5.298 KB
June 09 2025 11:12:39
root / root
0644
ext.py
25.821 KB
June 09 2025 11:12:39
root / root
0644
filters.py
40.444 KB
June 09 2025 11:12:39
root / root
0644
idtracking.py
8.995 KB
June 09 2025 11:12:39
root / root
0644
lexer.py
29.62 KB
June 09 2025 11:12:39
root / root
0644
loaders.py
17.252 KB
June 09 2025 11:12:39
root / root
0644
meta.py
4.034 KB
June 09 2025 11:12:39
root / root
0644
nativetypes.py
2.688 KB
June 09 2025 11:12:39
root / root
0644
nodes.py
30.366 KB
June 09 2025 11:12:39
root / root
0644
optimizer.py
1.423 KB
June 09 2025 11:12:39
root / root
0644
parser.py
34.824 KB
June 09 2025 11:12:39
root / root
0644
runtime.py
29.9 KB
June 09 2025 11:12:39
root / root
0644
sandbox.py
16.726 KB
June 09 2025 11:12:39
root / root
0644
tests.py
4.687 KB
June 09 2025 11:12:39
root / root
0644
utils.py
21.994 KB
June 09 2025 11:12:39
root / root
0644
visitor.py
3.164 KB
June 09 2025 11:12:39
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF