code: def test_load_state_dict_with_user_keys():
      engine = Engine(lambda e, b: 1)
      engine.state_dict_user_keys.append("alpha")
      engine.state_dict_user_keys.append("beta")
  
      def _test(sd):
          engine.load_state_dict(sd)
          if "iteration" in sd:
              assert sd["iteration"] == engine.state.iteration
          elif "epoch" in sd:
              assert sd["epoch"] == engine.state.epoch
          assert sd["epoch_length"] == engine.state.epoch_length
          assert sd["max_epochs"] == engine.state.max_epochs
          assert sd["alpha"] == engine.state.alpha
          assert sd["beta"] == engine.state.beta
  
      _test(
          {
              "max_epochs": 100,
              "epoch_length": 120,
              "iteration": 123,
              "alpha": 0.1,
              "beta": "abc",
          }
      )
  
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 6 for calling a global function with example usage: test_load_state_dict_with_user_keys() without return types