class_docstr: Utility that aggregates related log messages to reduce log spam.
docstr: Generate the aggregated log summary of all added events.
docstr_tok: ["Generate","the","aggregated","log","summary","of","all","added","events","."]
code: def summary(self) -> List[str]:
      """Generate the aggregated log summary of all added events."""
      with self.lock:
          out = []
          for template, quantity in self.events_by_key.items():
              out.append(template.format(quantity))
          out.extend(self.messages_to_send)
      return out
  
file_path: ray/python/ray/autoscaler/_private/event_summarizer.py
imports: import time
  from threading import RLock
  from typing import Any, Callable, Dict, List
label_desc: Use image node_id 4 for calling the EventSummarizer obj's underlying member method code with example usage: obj.summary() and returns: out