PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: optimizer.py Size: 1.68 KB
/lib/python3.6/site-packages/jinja2/optimizer.py

# -*- coding: utf-8 -*-
"""
    jinja2.optimizer
    ~~~~~~~~~~~~~~~~

    The jinja optimizer is currently trying to constant fold a few expressions
    and modify the AST in place so that it should be easier to evaluate it.

    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 scoping.

    The solution would be a second syntax tree that has the scoping rules stored.

    :copyright: (c) 2017 by the Jinja Team.
    :license: BSD.
"""
from jinja2 import nodes
from jinja2.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 fold(self, node, eval_ctx=None):
        """Do constant folding."""
        node = self.generic_visit(node)
        try:
            return nodes.Const.from_untrusted(node.as_const(eval_ctx),
                                              lineno=node.lineno,
                                              environment=self.environment)
        except nodes.Impossible:
            return node

    visit_Add = visit_Sub = visit_Mul = visit_Div = visit_FloorDiv = \
    visit_Pow = visit_Mod = visit_And = visit_Or = visit_Pos = visit_Neg = \
    visit_Not = visit_Compare = visit_Getitem = visit_Getattr = visit_Call = \
    visit_Filter = visit_Test = visit_CondExpr = fold
    del fold

Directory Contents

Dirs: 1 × Files: 27

Name Size Perms Modified Actions
- drwxr-xr-x 2025-04-06 18:04:22
Edit Download
4.05 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
7.69 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
12.49 KB lrw-r--r-- 2019-03-19 19:49:57
Edit Download
63.85 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
1.59 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
11.76 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
1.37 KB lrw-r--r-- 2019-03-19 19:49:57
Edit Download
49.66 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
4.32 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
23.93 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
36.27 KB lrw-r--r-- 2025-03-31 07:43:47
Edit Download
8.98 KB lrw-r--r-- 2019-03-19 19:49:57
Edit Download
27.89 KB lrw-r--r-- 2019-03-19 19:49:57
Edit Download
16.97 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
4.24 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
7.14 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
30.13 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
1.68 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
35.03 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
27.10 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
17.08 KB lrw-r--r-- 2025-03-31 07:43:47
Edit Download
4.14 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
20.29 KB lrw-r--r-- 2025-03-31 07:43:47
Edit Download
3.24 KB lrw-r--r-- 2019-03-19 19:47:45
Edit Download
2.54 KB lrw-r--r-- 2019-04-06 17:10:11
Edit Download
1.69 KB lrw-r--r-- 2019-03-19 19:49:57
Edit Download
2.55 KB lrw-r--r-- 2019-04-06 17:50:57
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI