code: def aggregate_event_counts(self, summarize_by, query=None,
                                 count_by=None, count_filter=None):
          
          return self._query('aggregate-event-counts',
                             query=query, summarize_by=summarize_by,
                             count_by=count_by, count_filter=count_filter)
docs: Get event counts from puppetdb aggregated into a single map.
  
          :param summarize_by: (Required) The object type to be counted on.
                               Valid values are 'containing_class', 'resource'
                               and 'certname' or any comma-separated value
                               thereof.
          :type summarize_by: :obj:`string`
          :param query: (Optional) The PuppetDB query to filter the results.
                        This query is passed to the `events` endpoint.
          :type query: :obj:`string`
          :param count_by: (Optional) The object type that is counted when
                           building the counts of 'successes', 'failures',
                           'noops' and 'skips'. Support values are 'certname'
                           and 'resource' (default)
          :type count_by: :obj:`string`
          :param count_filter: (Optional) A JSON query that is applied to the
                               event-counts output but before the results are
                               aggregated. Supported operators are `=`, `>`,
                               `<`, `>=`, and `<=`. Supported fields are
                               `failures`, `successes`, `noops`, and `skips`.
          :type count_filter: :obj:`string`
  
          :returns: A dictionary of name/value results.
          :rtype: :obj:`dict`