code: def F1(pre, rec):
      if pre + rec > 0:
          return (2.0 * pre * rec) / (pre + rec)
      else:
          return 0.0
  
file_path: dgl/examples/pytorch/NGCF/NGCF/utility/metrics.py
imports: import numpy
  from sklearn.metrics import roc_auc_score
label_desc: Use image node_id 9 for calling a global function with example usage: F1(pre, rec) and returns: unknown, int