code: def test_action_monitoring():
      """Action logging unit test"""
  
      # instantiate env
      env = build_dummy_maze_env()
  
      env = MazeEnvMonitoringWrapper.wrap(
          env,
          observation_logging=False,
          action_logging=True,
          reward_logging=False,
      )
      env = LogStatsWrapper.wrap(
          env
      )  # for accessing events from previous steps
      env.reset()
  
      # test application of wrapper
      for ii in range(2):
          env.step(env.action_space.sample())
  
          action_events = env.get_last_step_events(
              query=[
                  ActionEvents.discrete_action,
                  ActionEvents.continuous_action,
                  ActionEvents.multi_binary_action,
              ]
          )
  
          assert len(action_events) == 7
          for event in action_events:
              if event.attributes["name"] in [
                  "action_0_0",
                  "action_0_1_0",
                  "action_0_1_1",
                  "action_1_0",
              ]:
                  assert (
                      event.interface_method
                      == ActionEvents.discrete_action
                  )
              elif event.attributes["name"] in [
                  "action_0_2",
                  "action_2_0",
              ]:
                  assert (
                      event.interface_method
                      == ActionEvents.continuous_action
                  )
              elif event.attributes["name"] in ["action_1_1"]:
                  assert (
                      event.interface_method
                      == ActionEvents.multi_binary_action
                  )
              else:
                  raise ValueError
  
file_path: maze/maze/test/core/wrappers/test_monitoring_wrapper.py
imports: import numpy
  from maze.core.log_events.monitoring_events import ObservationEvents, RewardEvents, ActionEvents
  from maze.core.wrappers.log_stats_wrapper import LogStatsWrapper
  from maze.core.wrappers.monitoring_wrapper import MazeEnvMonitoringWrapper
  from maze.test.shared_test_utils.dummy_env.dummy_core_env import DummyCoreEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_maze_env import DummyEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_struct_env import DummyStructuredEnvironment
  from maze.test.shared_test_utils.dummy_env.space_interfaces.action_conversion.dict import DictActionConversion
  from maze.test.shared_test_utils.dummy_env.space_interfaces.observation_conversion.dict import ObservationConversion
  from maze.test.shared_test_utils.helper_functions import build_dummy_maze_env
label_desc: Use image node_id 4 for calling a global function with example usage: test_action_monitoring() without return types