<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def format_item(item, template, name='item'):
 """Render a template to a string with the provided item in context."""

    ctx = {name: item}
    return render_template_to_string(template, **ctx)