Returns

def template(filename, **locals):
    ''' Returns '''
    path = 'templates/{}'.format(filename)
    with open(path) as source:
        code = compile(source.read(), path, 'exec')
        global_vars = {'t': t,
                       'f': f,
                       'e': e,
                       'escape': html.escape,
                       'ctime': time.ctime}
        exec(code, global_vars, locals)
        return locals['page']