import csv


def load_label(filename):
    """
    process the .csv label file
    Args:
        filename: /path/to/file/of/csvlabel/ (csv)
    Return:
        dirname_label_map: a hashmap {dirname <--> label} (dict: str->list[int])
    Example:
        {..., INDEX10097: [3, 7] ,}
    """
    dirname_label_map = {}
    with open(filename,'r') as cfile:
        reader = csv.reader(cfile)
        for row in reader:
            name = row[0]
            label = (row[1]).split(';')
            int_label = [int(lab) for lab in label]
            dirname_label_map[name] = int_label
    return dirname_label_map