def render(template=None, ostr=None, **kwargs):
jinja_environment.filters['<STR_LIT>'] = tex_escape<EOL>template = template or DEFAULT_TEMPLATE<EOL>ostr = ostr or sys.stdout<EOL>jinja_template = jinja_environment.get_template(template)<EOL>jinja_template.stream(**kwargs).dump(ostr)<EOL>
Generate report from a campaign

    :param template: Jinja template to use, ``DEFAULT_TEMPLATE`` is used
    if not specified
    :param ostr: output file or filename. Default is standard output