<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_dataset(self, dataset, name, color):
 """ Encode a dataset """

        global palette
        html = "{"
        html += '\t"label": "' + name + '",'
        if color is not None:
            html += '"backgroundColor": "' + color + '",\n'
        else:
            html += '"backgroundColor": ' + palette + ',\n'
        html += '"data": ' + self._format_list(dataset) + ',\n'
        html += "}"
        return html