<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def template_string(context, template):
    'Return the rendered template content with the current context'
    if not isinstance(context, Context):
        context = Context(context)
    return Template(template).render(context)