def METHOD_NAME(vaccination_events):
    """
    Takes a flat list of vaccination events and groups by patient and vaccine
    name, yielding results like:
        patient_id, [
            vaccine1: [
              date_1,
              date_2,
              ...
            ],
            vaccine2: [
              date_1,
              date_2,
              ...
            ],
        ]
    """
    get_patient_id = lambda row: row["patient_id"]  # noqa
    for patient_id, group in itertools.groupby(vaccination_events, key=get_patient_id):
        vaccine_dates = defaultdict(list)
        for row in group:
            vaccine_name = row["vaccine_name"]
            date_given = datetime.date.fromisoformat(row["date_given"])
            vaccine_dates[vaccine_name].append(date_given)
        yield patient_id, vaccine_dates.items()