code: def test_output_handler_with_global_step_from_engine():
      mock_another_engine = MagicMock()
      mock_another_engine.state = State()
      mock_another_engine.state.epoch = 10
      mock_another_engine.state.output = 12.345
  
      wrapper = OutputHandler(
          "tag",
          output_transform=lambda x: {"loss": x},
          global_step_transform=global_step_from_engine(
              mock_another_engine
          ),
      )
  
      logger = NeptuneLogger(
          project="tests/dry-run",
          mode="debug",
      )
      mock_engine = MagicMock()
      mock_engine.state = State()
      mock_engine.state.epoch = 1
      mock_engine.state.output = 0.123
  
      wrapper(mock_engine, logger, Events.EPOCH_STARTED)
      assert_logger_called_once_with(
          logger, "tag/loss", mock_engine.state.output
      )
  
      mock_another_engine.state.epoch = 11
      mock_engine.state.output = 1.123
  
      wrapper(mock_engine, logger, Events.EPOCH_STARTED)
  
      result = logger["tag/loss"].fetch_values()
      assert len(result.value) == 2
      assert result.value[1] == mock_engine.state.output
  
      logger.stop()
  
imports: import math
  import warnings
  from unittest.mock import MagicMock
  import pytest
  import torch
  from ignite.contrib.handlers.neptune_logger import global_step_from_engine, GradsScalarHandler, NeptuneLogger, NeptuneSaver, OptimizerParamsHandler, OutputHandler, WeightsScalarHandler
  from ignite.engine import Engine, Events, State
label_desc: Use image node_id 9 for calling a global function with example usage: test_output_handler_with_global_step_from_engine() without return types