code: def test_event_skip_aggregation():
      """test the once-per-step logging"""
  
      class _EventInterface(ABC):
          @define_step_stats(None)
          def event1(self, attr1):
              pass
  
      agg = LogStatsAggregator(LogStatsLevel.STEP)
      agg.add_event(
          EventRecord(
              _EventInterface, _EventInterface.event1, dict(attr1=3)
          )
      )
  
      stats = agg.reduce()
      assert len(stats) == 1
  
      key, value = next(iter(stats.items()))
      assert value == 3
      # tuple (event, output name)
      assert key == (_EventInterface.event1, None, None)
  
      # check if multiple calls per step are correctly detected
      with pytest.raises(AssertionError):
          agg.add_event(
              EventRecord(
                  _EventInterface, _EventInterface.event1, dict(attr1=3)
              )
          )
          agg.add_event(
              EventRecord(
                  _EventInterface, _EventInterface.event1, dict(attr1=3)
              )
          )
          agg.reduce()
  
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 4 for calling a global function with example usage: test_event_skip_aggregation() without return types