code: def test_param_scheduler_with_ema_handler():
      from ignite.handlers import EMAHandler
  
      model = nn.Linear(2, 1)
      trainer = Engine(lambda e, b: model(b))
      data = torch.rand(100, 2)
  
      param_name = "ema_decay"
  
      ema_handler = EMAHandler(model)
      ema_handler.attach(
          trainer, name=param_name, event=Events.ITERATION_COMPLETED
      )
  
      ema_decay_scheduler = PiecewiseLinearStateScheduler(
          param_name=param_name,
          milestones_values=[(0, 0.0), (10, 0.999)],
          save_history=True,
      )
      ema_decay_scheduler.attach(trainer, Events.ITERATION_COMPLETED)
      trainer.run(data, max_epochs=20)
  
imports: import re
  from pathlib import Path
  from unittest.mock import patch
  import pytest
  import torch
  import torch.nn
  from packaging.version import Version
  from ignite.engine import Engine, Events
  from ignite.handlers.state_param_scheduler import ExpStateScheduler, LambdaStateScheduler, MultiStepStateScheduler, PiecewiseLinearStateScheduler, StepStateScheduler
  from bisect import bisect_right
label_desc: Use image node_id 19 for calling a global function with example usage: test_param_scheduler_with_ema_handler() without return types