code: def test_multi_grouping():
      """test grouping by three attributes"""
  
      class _EventInterface(ABC):
          @define_stats_grouping("group1", "group2", "group3")
          @define_step_stats(sum)
          def event1(self, group1, group2, group3, attr1):
              pass
  
      agg = LogStatsAggregator(LogStatsLevel.STEP)
      for i in [1, 8]:
          agg.add_event(
              EventRecord(
                  _EventInterface,
                  _EventInterface.event1,
                  dict(group1=1, group2=0, group3=0, attr1=1 * i),
              )
          )
          agg.add_event(
              EventRecord(
                  _EventInterface,
                  _EventInterface.event1,
                  dict(group1=0, group2=1, group3=0, attr1=2 * i),
              )
          )
          agg.add_event(
              EventRecord(
                  _EventInterface,
                  _EventInterface.event1,
                  dict(group1=0, group2=0, group3=1, attr1=4 * i),
              )
          )
  
      stats = agg.reduce()
      assert len(stats) == 3
  
      assert stats[(_EventInterface.event1, None, (1, 0, 0))] == 9
      assert stats[(_EventInterface.event1, None, (0, 1, 0))] == 18
      assert stats[(_EventInterface.event1, None, (0, 0, 1))] == 36
  
file_path: maze/maze/test/core/test_log_stats.py
imports: from abc import ABC
  import numpy
  import pytest
  from maze.core.events.event_record import EventRecord
  from maze.core.log_stats.event_decorators import define_step_stats, define_episode_stats, define_epoch_stats, define_stats_grouping
  from maze.core.log_stats.log_stats import LogStatsAggregator, LogStatsLevel
  from maze.core.log_stats.reducer_functions import histogram
label_desc: Use image node_id 9 for calling a global function with example usage: test_multi_grouping() without return types