code: def test_event_attributes():
      """test the aggregation of individual event attributes"""
  
      class _EventInterface(ABC):
          @define_step_stats(sum, input_name="attr1")
          @define_step_stats(sum, input_name="attr2")
          def event1(self, attr1, attr2):
              pass
  
      agg = LogStatsAggregator(LogStatsLevel.STEP)
      agg.add_event(
          EventRecord(
              _EventInterface,
              _EventInterface.event1,
              dict(attr1=1, attr2=3),
          )
      )
      agg.add_event(
          EventRecord(
              _EventInterface,
              _EventInterface.event1,
              dict(attr1=1, attr2=3),
          )
      )
  
      stats = agg.reduce()
      assert len(stats) == 2
  
      value1 = stats[(_EventInterface.event1, "attr1", None)]
      value2 = stats[(_EventInterface.event1, "attr2", None)]
  
      assert value1 == 2
      assert value2 == 6
  
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 1 for calling a global function with example usage: test_event_attributes() without return types