code: def get_models(self, decay=0.9999):
      unet = UNet2DConditionModel.from_pretrained(
          self.model_id, subfolder="unet"
      )
      unet = unet.to(torch_device)
      ema_unet = EMAModel(
          unet.parameters(),
          decay=decay,
          model_cls=UNet2DConditionModel,
          model_config=unet.config,
      )
      return unet, ema_unet
  
file_path: diffusers/tests/others/test_ema.py
imports: import tempfile
  import unittest
  import torch
  from diffusers import UNet2DConditionModel
  from diffusers.training_utils import EMAModel
  from diffusers.utils.testing_utils import enable_full_determinism, skip_mps, torch_device
label_desc: Use image node_id 1 for calling the EMAModelTests obj's underlying member method code with example usage: obj.get_models(decay) and returns: unet,  ema_unet