<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def out_filename(template, n_val, mode):
 """Determine the output filename"""

    return '{0}_{1}_{2}.cpp'.format(template.name, n_val, mode.identifier)