def METHOD_NAME(data, csv_file):
    """Write the data collected from the .state into a CSV file.
    Args:
        data (dict): dictionary containing the info from the .state file.
        csv_file (string): path to the CSV file.
    """
    header = not isfile(csv_file)
    with open(csv_file, 'a', newline='') as f:
        csv_writer = csv.writer(f)
        if header:
            csv_writer.writerow(list(data))
        csv_writer.writerow(list(data.values()))
    logger.debug(f'Added new entry in {csv_file}')