lf NdZddlmZGddeZGddeZdS)zVAPI for traversing the AST nodes. Implemented by the compiler and meta introspection. )Nodec$eZdZdZdZdZdZdS) NodeVisitoraWalks the abstract syntax tree and call visitor functions for every node found. The visitor functions may return values which will be forwarded by the `visit` method. Per default the visitor functions for the nodes are ``'visit_'`` + class name of the node. So a `TryFinally` node visit function would be `visit_TryFinally`. This behavior can be changed by overriding the `get_visitor` function. If no visitor function exists for a node (return value `None`) the `generic_visit` visitor is used instead. cBd|jjz}t||dS)zReturn the visitor function for this node or `None` if no visitor exists for this node. In that case the generic visit function is used instead. visit_N) __class____name__getattr)selfnodemethods n/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/jinja2/visitor.py get_visitorzNodeVisitor.get_visitors% DN33tVT***cj||}| ||g|Ri|S|j|g|Ri|S)z Visit a node.)r generic_visit)r r argskwargsfs rvisitzNodeVisitor.visits]   T " " =1T+D+++F++ +!t!$8888888rcV|D]}|j|g|Ri|dS)z9Called if no explicit visitor function exists for a node.N)iter_child_nodesr)r r rrs rrzNodeVisitor.generic_visit#sL))++ . .D DJt -d - - -f - - - - . .rN)r __module__ __qualname____doc__rrrrrrrsK  +++999.....rrceZdZdZdZdZdS)NodeTransformeraWalks the abstract syntax tree and allows modifications of nodes. The `NodeTransformer` will walk the AST and use the return value of the visitor functions to replace or remove the old node. If the return value of the visitor function is `None` the node will be removed from the previous location otherwise it's replaced with the return value. The return value may be the original node in which case no replacement takes place. c|D]\}}t|trxg}|D]k}t|tr?|j|g|Ri|}|+t|ts||V||l||dd<t|tr5|j|g|Ri|}|t||t||||S)N) iter_fields isinstancelistrrextendappenddelattrsetattr) r r rrfield old_value new_valuesvaluenew_nodes rrzNodeTransformer.generic_visit4s6 $ 0 0 2 2 3 3 E9)T** 3 &--E!%..% * 5 B4 B B B6 B B =$!+E4!8!8%&--e444$%%e,,,,) !!! It,, 3%4:iA$AAA&AA#D%((((D%222 rcX|j|g|Ri|}t|ts|g}|S)z{As transformers may return lists in some places this method can be used to enforce a list as return value. )rr!r")r r rrrvs r visit_listzNodeTransformer.visit_listJsCTZ .t . . .v . ."d## B rN)r rrrrr.rrrrr)s<,rrN)rnodesrobjectrrrrrr1s.....&...B(((((k(((((r