<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _generate_ngram_row_template(self, labels):
 """Returns the HTML template for a row in the n-gram table."""

        cells = ['<td>{ngram}</td>']
        for label in labels:
            cells.append('<td>{{{}}}</td>'.format(label))
        return '\n'.join(cells)