(item: Tuple[str, List[Dict[str, Any]]])
| 604 | |
| 605 | |
| 606 | def episode_sort_key(item: Tuple[str, List[Dict[str, Any]]]) -> Tuple[str, str, str]: |
| 607 | episode_id, rows = item |
| 608 | first = rows[0] if rows else {} |
| 609 | return ( |
| 610 | str(first.get("user_id") or episode_id.split("::", 1)[0]), |
| 611 | str(first.get("date") or ""), |
| 612 | episode_id, |
| 613 | ) |
| 614 | |
| 615 | |
| 616 | def max_log_citations_for_day(rows: Sequence[Dict[str, Any]]) -> float: |