Coder en python un outil ressemblant à apachetop.
Implement a batch version that answers Apachetop-style rolling traffic summaries. Events and query times are chronological, and each query considers events in [query_time - window_seconds, query_time].
Use def apachetop_summary(events, queries, window_seconds, top_k):. Each event is (timestamp, path, status, bytes). Return one list per query, with entries containing path, requests, bytes, and errors, ordered by descending request count, descending bytes, then ascending path. An error has status >= 400.
def apachetop_summary(events, queries, window_seconds, top_k):