code: def _loss_value(loss: mx.metric.Loss) -> float:
      return loss.get_name_value()[0][1]
  
imports: import itertools
  import logging
  import time
  from typing import List, Optional
  import mxnet
  import numpy
  from gluonts.core.component import validated
  from gluonts.dataset.loader import DataLoader
  from gluonts.gluonts_tqdm import tqdm
  from gluonts.mx.trainer import Trainer
  from gluonts.mx.util import HybridContext
  from mxnet import autograd
  from mxnet.gluon import nn
  from mxnet.metric import ndarray
  from .callbacks import Callback, CallbackList
label_desc: Use image node_id 1 for calling a global function with example usage: _loss_value(loss) and returns: loss