code: def get_loss_steps(loss_name: str, trainer: Trainer):
      loss = trainer.logger.experiment.metrics
      ep = trainer.current_epoch
      out = [l[loss_name] for l in loss if loss_name in l]
      start = 1 if "val" in loss_name else 0
      return out, np.linspace(start, ep, len(out))
  
imports: from pytorch_lightning.loggers import CSVLogger
  from pytorch_lightning import Trainer
  import numpy
  from pathlib import Path
label_desc: Use image node_id 2 for calling a global function with example usage: get_loss_steps(loss_name, trainer) and returns: out,  np