code: def f1(p, r):
      if p == 0.0 or r == 0.0:
          return 0.0
      return 2 * p * r / (p + r)
  
file_path: OpenPrompt/openprompt/utils/metrics.py
imports: from sklearn.metrics import f1_score, precision_score, recall_score, accuracy_score
  from typing import *
  from openprompt.utils.logging import logger
label_desc: Use image node_id 1 for calling a global function with example usage: f1(p, r) and returns: unknown, int