code: def _get_dataset(self, dataset, name, color):
          
          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
docs: Encode a dataset