code: def timed_generator(gen):
      start = time.time()
      for g in gen:
          end = time.time()
          t = end - start
          yield g, t
          start = time.time()
  
imports: import math
  import os
  import numpy
  import torch
  import shutil
  import signal
  import torch.distributed
label_desc: Use image node_id 1 for calling a global function with example usage: timed_generator(gen) without return types