parameters: (self, old_snapshot, key_type, cumulative=False)
return_statement: return statistics
docstring: Compute the differences with an old snapshot old_snapshot. Get
          statistics as a sorted list of StatisticDiff instances, grouped by
          group_by.
docstring_summary: Compute the differences with an old snapshot old_snapshot. Get
          statistics as a sorted list of StatisticDiff instances, grouped by
          group_by.
docstring_tokens: Compute the differences with an old snapshot old_snapshot . Get statistics as a sorted list of StatisticDiff instances grouped by group_by .
function: def compare_to(self, old_snapshot, key_type, cumulative=False):
          """
          Compute the differences with an old snapshot old_snapshot. Get
          statistics as a sorted list of StatisticDiff instances, grouped by
          group_by.
          """
          new_group = self._group_by(key_type, cumulative)
          old_group = old_snapshot._group_by(key_type, cumulative)
          statistics = _compare_grouped_stats(old_group, new_group)
          statistics.sort(reverse=True, key=StatisticDiff._sort_key)
          return statistics
function_tokens: def compare_to ( self , old_snapshot , key_type , cumulative = False ) : new_group = self . _group_by ( key_type , cumulative ) old_group = old_snapshot . _group_by ( key_type , cumulative ) statistics = _compare_grouped_stats ( old_group , new_group ) statistics . sort ( reverse = True , key = StatisticDiff . _sort_key ) return statistics