from io import StringIO
import csv


def _rows_to_csv_py3(rows):
    """convert rows to csv text.

    Args:
        rows: an iterable of rows to write to csv

    Return:
        unicode string, the csv text

    """
    f = StringIO()
    w = csv.writer(f)
    w.writerows(rows)
    return f.getvalue()