jinja2.sandbox.SandboxedEnvironment.preprocess

SandboxedEnvironment.preprocess(source, name=None, filename=None)

Preprocesses the source with all extensions. This is automatically called for all parsing and compiling methods but not for lex() because there you usually only want the actual source tokenized.