Write a program renderer.py that reads a custom template format from stdin and renders it to stdout.
Write a program renderer.py that reads a custom template format from stdin and renders it to stdout.: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Template format: - A template is a mix of literal text and directives . - A directive is {{ KEY }} where KEY is a…
The task
**Template format:** - A template is a mix of literal text and **directives**. - A directive is `{{ KEY }}` where KEY is a non-empty string of alphanumerics and underscores (regex `[A-Za-z0-9_]+`). - Directives may have leading/trailing whitespace inside the braces: `{{ KEY }}` is identical to `{{KEY}}`. - Literal…
Part of ai-and/termgrade-environments.