1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
from collections import defaultdict

def blah(db_instance_identifier):
    evpc.rds.describe_db_snapshots(DBInstanceIdentifier=db_instance_identifier)['DBSnapshots']

def bleh(snapshot_descriptions):
    snapshots_by_date = defaultdict(list)
    for snapshot in snapshot_descriptions:
        date_str = snapshot['SnapshotCreateTime'].strftime("%Y-%m-%d")
        snapshots_by_date[date_str].append(snapshot)
    return snapshots_by_date