def write_csv(filename, headers, entries):
    """
    Writes a CSV file with the provided parameters.
    """
    with open(os.path.expanduser(filename), "w") as export_file:
        csv_file = csv.writer(
            export_file,
            delimiter=";",
            quoting=csv.QUOTE_ALL,
            lineterminator="\n",
            escapechar="\\",
        )
        csv_file.writerow(headers)
        for entry in entries:
            csv_file.writerow(entry)

    Writes a CSV file with the provided parameters.
    
cme/cmedb.py