def METHOD_NAME() -> Dict[str, int]:
    with stats.get_connection() as cursor:
        cursor.execute('''
            SELECT max(value) as value, cast(date as date) as date, printer
                FROM printer_pages_public
                GROUP BY cast(date as date), printer
                ORDER BY date ASC, printer ASC
        ''')
        # Resolves the issue of possible missing dates.
        # defaultdict(lambda: defaultdict(int)) doesn't work due to inability to pickle local objects like lambdas;
        # this effectively does the same thing as that.
        pages_printed: Dict[Any, Any] = defaultdict(partial(defaultdict, int))
        last_seen: Dict[Any, Any] = {}
        for row in cursor:
            if row['printer'] in last_seen:
                pages_printed.setdefault(row['date'], defaultdict(int))
                pages_printed[row['date']][row['printer']] = (
                    row['value'] - last_seen[row['printer']]
                )
            last_seen[row['printer']] = row['value']
    return pages_printed