code: def b_cubed(clusters, mention_to_gold):
      num, dem = 0, 0
  
      for c in clusters:
          if len(c) == 1:
              continue
  
          gold_counts = Counter()
          correct = 0
          for m in c:
              if m in mention_to_gold:
                  gold_counts[tuple(mention_to_gold[m])] += 1
          for c2, count in gold_counts.items():
              # if len(c2) != 1:
              correct += count * count
  
          num += correct / float(len(c))
          dem += len(c)
  
      return num, dem
  
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 3 for calling a global function with example usage: b_cubed(clusters, mention_to_gold) and returns: num,  dem