code: def update(self, num):
      prev_ema = num if self.ema is None else self.ema
      self.ema = self.alpha * prev_ema + (1.0 - self.alpha) * num
      return self.ema
  
imports: import os
  import torch
  import random
  import numpy
  from transformers import set_seed, AutoTokenizer
  import json
  import deepspeed
  from deepspeed.runtime.zero.partition_parameters import ZeroParamStatus
  from deepspeed.accelerator import get_accelerator
  import torch.nn
label_desc: Use image node_id 2 for calling the ExponentialMovingAverage obj's underlying member method code with example usage: obj.update(num) and returns: self