from typing import Tuple
from typing import List
from typing import Dict
import csv


def parse_csv(csvfile: str) -> Tuple[List[str], List[str], List[str]]:
    """Open and parse csv.

    Args:
        csvfile: path to csvfile

    Returns:
        a tuple of lists for images, labels, and notes
    """
    with open(csvfile) as fp:
        D: Dict[str, list] = {"image": [], "label": [], "note": []}
        reader = csv.DictReader(fp)
        for row in reader:
            for key, val in row.items():
                D[key.lower()].append(val)
    return D["image"], D["label"], D["note"]