(item: Tuple[str, List[Dict[str, Any]]])
| 704 | |
| 705 | |
| 706 | def episode_sort_key(item: Tuple[str, List[Dict[str, Any]]]) -> Tuple[str, str, str]: |
| 707 | episode_id, rows = item |
| 708 | first = rows[0] if rows else {} |
| 709 | return ( |
| 710 | str(first.get("user_id") or episode_id.split("::", 1)[0]), |
| 711 | str(first.get("date") or ""), |
| 712 | episode_id, |
| 713 | ) |
| 714 | |
| 715 | |
| 716 | def max_log_citations_for_day(rows: Sequence[Dict[str, Any]]) -> float: |