code: def test_state_dict_with_user_keys_integration(dirname):
      engine = Engine(lambda e, b: 1)
      engine.state_dict_user_keys.append("alpha")
  
      @engine.on(Events.STARTED)
      def init_user_values(_):
          engine.state.alpha = 0.1
  
      fp = dirname / "engine.pt"
  
      @engine.on(Events.COMPLETED)
      def save_engine(_):
          state_dict = engine.state_dict()
          assert "alpha" in state_dict
          torch.save(state_dict, fp)
  
      engine.run([0, 1])
  
      assert fp.exists()
      state_dict = torch.load(fp)
      assert "alpha" in state_dict and state_dict["alpha"] == 0.1
  
file_path: ignite/tests/ignite/engine/test_engine_state_dict.py
imports: from collections.abc import Mapping
  import pytest
  import torch
  from ignite.engine import Engine, Events, State
  from tests.ignite.engine import BatchChecker, EpochCounter, IterationCounter
label_desc: Use image node_id 11 for calling a global function with example usage: test_state_dict_with_user_keys_integration(dirname) without return types