code: def get_weighted_sum(sample, weights):
      loss_weighted = 0
      for loss, weight in weights.items():
          loss_weighted += sample.losses[loss] * weight
      sample.losses["loss_weighted"] = loss_weighted
      return sample
  
file_path: icevision/icevision/models/interpretation.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.data import *
  from icevision.visualize.show_data import show_preds
  from icevision.core.record_components import LossesRecordComponent
label_desc: Use image node_id 1 for calling a global function with example usage: get_weighted_sum(sample, weights) and returns: sample