code: def elapsed(collection):
      """
      similar to enumerate but prepend elapsed time since loop starts.
      """
      tic = time.time()
      for x in collection:
          yield time.time() - tic, x
  
file_path: gluonts/src/gluonts/nursery/gmm_tpp/gmm_base.py
imports: import time
  import mxnet
  from mxnet import gluon
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: elapsed(collection) without return types