code: def test_integration():
      n_epochs = 5
      data = list(range(50))
  
      losses = torch.rand(n_epochs * len(data))
      losses_iter = iter(losses)
  
      def update_fn(engine, batch):
          return next(losses_iter)
  
      trainer = Engine(update_fn)
  
      npt_logger = NeptuneLogger(mode="offline")
  
      def dummy_handler(engine, logger, event_name):
          global_step = engine.state.get_event_attrib_value(event_name)
          logger["test_value"].append(global_step, step=global_step)
  
      npt_logger.attach(
          trainer,
          log_handler=dummy_handler,
          event_name=Events.EPOCH_COMPLETED,
      )
  
      trainer.run(data, max_epochs=n_epochs)
      npt_logger.close()
  
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 18 for calling a global function with example usage: test_integration() and returns: next