docstr: Should return stats grouped by category_name and cache_name.
  byte_length should be summed.
docstr_tok: ["Should","return","stats","grouped","by","category_name","and","cache_name",".","byte_length","should","be","summed","."]
code: def test_group_stats(self):
      """Should return stats grouped by category_name and cache_name.
      byte_length should be summed."""
  
      # Similar stats sequential
      stats1 = [
          CacheStat("provider1", "foo", 1),
          CacheStat("provider1", "bar", 2),
          CacheStat("provider1", "bar", 5),
      ]
  
      # Similar stats not sequential
      stats2 = [
          CacheStat("provider2", "baz", 3),
          CacheStat("provider2", "qux", 4),
          CacheStat("provider2", "baz", 28),
      ]
  
      # All the same stats
      stats3 = [
          CacheStat("provider3", "boo", 1),
          CacheStat("provider3", "boo", 1),
          CacheStat("provider3", "boo", 1),
          CacheStat("provider3", "boo", 1),
          CacheStat("provider3", "boo", 1),
          CacheStat("provider3", "boo", 1),
          CacheStat("provider3", "boo", 1),
      ]
  
      self.assertEqual(
          set(group_stats(stats1)),
          {
              CacheStat("provider1", "foo", 1),
              CacheStat("provider1", "bar", 7),
          },
      )
  
      self.assertEqual(
          set(group_stats(stats2)),
          {
              CacheStat("provider2", "baz", 31),
              CacheStat("provider2", "qux", 4),
          },
      )
  
      self.assertEqual(
          set(group_stats(stats3)),
          {
              CacheStat("provider3", "boo", 7),
          },
      )
  
file_path: streamlit/lib/tests/streamlit/runtime/stats_test.py
imports: import unittest
  from typing import List
  from streamlit.runtime.stats import CacheStat, CacheStatsProvider, StatsManager, group_stats
label_desc: Use image node_id 2 for calling the StatsManagerTest obj's underlying member method code with example usage: obj.test_group_stats() without return types