code: def f1(p_num, p_den, r_num, r_den, beta=1):
      p = 0 if p_den == 0 else p_num / float(p_den)
      r = 0 if r_den == 0 else r_num / float(r_den)
      return (
          0
          if p + r == 0
          else (1 + beta * beta) * p * r / (beta * beta * p + r)
      )
  
imports: import logging
  import numpy
  from collections import Counter, defaultdict
  from scipy.optimize import linear_sum_assignment
  from .blanc import blanc, tuple_to_metric
label_desc: Use image node_id 1 for calling a global function with example usage: f1(p_num, p_den, r_num, r_den, beta) and returns: unknown