MCPcopy
hub / github.com/pallets/jinja / optimize

Function optimize

src/jinja2/optimizer.py:20–24  ·  view source on GitHub ↗

The context hint can be used to perform an static optimization based on the context given.

(node: nodes.Node, environment: "Environment")

Source from the content-addressed store, hash-verified

18
19
20def optimize(node: nodes.Node, environment: "Environment") -> nodes.Node:
21 """The context hint can be used to perform an static optimization
22 based on the context given."""
23 optimizer = Optimizer(environment)
24 return t.cast(nodes.Node, optimizer.visit(node))
25
26
27class Optimizer(NodeTransformer):

Callers

nothing calls this directly

Calls 2

OptimizerClass · 0.85
visitMethod · 0.80

Tested by

no test coverage detected