code: def CompileReport(self, mediator):
      
      results = {}
      for key, count in iter(self._counter.items()):
        search_engine, _, search_term = key.partition(':')
        results.setdefault(search_engine, {})
        results[search_engine][search_term] = count
  
      lines_of_text = []
      for search_engine, terms in sorted(results.items()):
        lines_of_text.append(' == ENGINE: {0:s} =='.format(search_engine))
  
        for search_term, count in sorted(
            terms.items(), key=lambda x: (x[1], x[0]), reverse=True):
          lines_of_text.append('{0:d} {1:s}'.format(count, search_term))
  
        # An empty string is added to have SetText create an empty line.
        lines_of_text.append('')
  
      lines_of_text.append('')
      report_text = '\n'.join(lines_of_text)
      analysis_report = reports.AnalysisReport(
          plugin_name=self.NAME, text=report_text)
      analysis_report.report_array = self._search_term_timeline
      analysis_report.report_dict = results
      return analysis_report
docs: Compiles an analysis report.
  
      Args:
        mediator (AnalysisMediator): mediates interactions between
            analysis plugins and other components, such as storage and dfvfs.
  
      Returns:
        AnalysisReport: analysis report.