jinja2.sandbox.ImmutableSandboxedEnvironment.preprocess

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