code: def test_ema_get_const_momentum(get_dummy_model):
      """Test if momentum retrieved from the engine is constant and equal to the handler's momentum"""
      model = get_dummy_model()
      step_fn = _get_dummy_step_fn(model)
      engine = Engine(step_fn)
  
      def assert_const_momentum(engine: Engine, const_momentum):
          assert engine.state.ema_momentum == const_momentum
  
      ema_handler = EMAHandler(model, momentum=0.002)
      ema_handler.attach(engine)
      engine.add_event_handler(
          Events.ITERATION_COMPLETED,
          assert_const_momentum,
          ema_handler.momentum,
      )
      engine.run(range(10))
  
imports: import os
  from typing import Any, Callable, Union
  import pytest
  import torch
  import torch.nn
  from torch.nn.parallel import DataParallel, DistributedDataParallel
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.handlers import EMAHandler
label_desc: Use image node_id 11 for calling a global function with example usage: test_ema_get_const_momentum(get_dummy_model) without return types