code: def calculate_measure(tp, fn, fp):
      # avoid nan
      if tp == 0:
          return 0, 0, 0
  
      p = tp * 1.0 / (tp + fp)
      r = tp * 1.0 / (tp + fn)
      if (p + r) > 0:
          f1 = 2.0 * (p * r) / (p + r)
      else:
          f1 = 0
      return p, r, f1
  
file_path: dgl/examples/pytorch/evolveGCN/utils.py
label_desc: Use image node_id 1 for calling a global function with example usage: calculate_measure(tp, fn, fp) and returns: p,  r,  f1, int,  int,  int