def export_metric(self, output, metric, header=None, sparse=False):
    if sparse:
        raise NotImplementedError('sparse is not supported yet.')
    writer = csv.writer(output)
    if (header is not None):
        writer.writerow(header)
    for row in metric:
        writer.writerow(row)
def export_metric(self, output, metric, header=None, sparse=False):
    if sparse:
        raise NotImplementedError('sparse is not supported yet.')
    writer = csv.writer(output)
    if (header is not None):
        writer.writerow(header)
    for row in metric:
        writer.writerow(row)