code: def get_weight(src, mask, threshold, weight):
      count_pos = src[mask >= threshold].size()[0]
      count_neg = src[mask == 0.0].size()[0]
      total = count_neg + count_pos
      weight_pos = count_neg / total
      weight_neg = (count_pos / total) * weight
      return weight_pos, weight_neg
  
imports: import torch.nn.functional
  from .utils import *
  from .backbone import *
label_desc: Use image node_id 5 for calling a global function with example usage: get_weight(src, mask, threshold, weight) and returns: weight_pos,  weight_neg