code: def lea(clusters, mention_to_gold):
      num, dem = 0, 0
  
      for c in clusters:
          if len(c) == 1:
              continue
  
          common_links = 0
          all_links = len(c) * (len(c) - 1) / 2.0
          for i, m in enumerate(c):
              if m in mention_to_gold:
                  for m2 in c[i + 1 :]:
                      if (
                          m2 in mention_to_gold
                          and mention_to_gold[m] == mention_to_gold[m2]
                      ):
                          common_links += 1
  
          num += len(c) * common_links / float(all_links)
          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 7 for calling a global function with example usage: lea(clusters, mention_to_gold) and returns: num,  dem