class_docstr: Run queries to generate statistics on alerts.
docstr: Sort and format the alert statistics info
  
  Args:
      stats (list<StagingStatistic>): Group of rule staging statistics
          that are being reported on
  
  Returns:
      str: Entire message digest to be sent to SNS, sorted with statistics
          that have the highest alert count at the top
docstr_tok: ["Sort","and","format","the","alert","statistics","info","Args",":","stats","(","list","<","StagingStatistic",">",")",":","Group","of","rule","staging","statistics","that","are","being","reported","on","Returns",":","str",":","Entire","message","digest","to","be","sent","to","SNS",",","sorted","with","statistics","that","have","the","highest","alert","count","at","the","top"]
code: def _format_digest(stats):
      """Sort and format the alert statistics info
  
      Args:
          stats (list<StagingStatistic>): Group of rule staging statistics
              that are being reported on
  
      Returns:
          str: Entire message digest to be sent to SNS, sorted with statistics
              that have the highest alert count at the top
      """
      if not stats:
          return "No currently staged rules to report on"
  
      return "\n\n".join(
          str(stat) for stat in sorted(stats, reverse=True)
      )
  
file_path: streamalert/streamalert/rule_promotion/publisher.py
imports: import boto3
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 3 for calling the StatsPublisher obj's underlying member method code with example usage: obj._format_digest(stats) and returns: str, str