MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _build_topic_groups

Function _build_topic_groups

agents/wiki-agent/export/monthly_report.py:253–261  ·  view source on GitHub ↗
(rows: List[Dict[str, Any]])

Source from the content-addressed store, hash-verified

251
252
253def _build_topic_groups(rows: List[Dict[str, Any]]) -> Dict[str, List[Dict[str, Any]]]:
254 grouped: Dict[str, List[Dict[str, Any]]] = defaultdict(list)
255 for row in rows:
256 for keyword in row["keywords"]:
257 grouped[keyword].append(row)
258 return {
259 topic: sorted(items, key=lambda item: (item["date"], item["title"]))
260 for topic, items in sorted(grouped.items(), key=lambda item: (-len(item[1]), item[0]))
261 }
262
263
264def _render_monthly_report(user_id: str, month: str, rows: List[Dict[str, Any]]) -> str:

Callers 3

_render_monthly_reportFunction · 0.85
_render_topic_indexFunction · 0.85
export_monthly_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected