code: def find_coref(ment, mentlist, person_names):
      cur_m = ment["mention"].lower()
      coref = []
      for m in mentlist:
          if (
              len(m["candidates"]) == 0
              or m["candidates"][0][0] not in person_names
          ):
              continue
  
          mention = m["mention"].lower()
          start_pos = mention.find(cur_m)
          if start_pos == -1 or mention == cur_m:
              continue
  
          end_pos = start_pos + len(cur_m) - 1
          if (start_pos == 0 or mention[start_pos - 1] == " ") and (
              end_pos == len(mention) - 1 or mention[end_pos + 1] == " "
          ):
              coref.append(m)
  
      return coref
  
file_path: BLINK/blink/candidate_retrieval/dataset.py
imports: import re
  import pickle
  import os
  import time
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: find_coref(ment, mentlist, person_names) and returns: coref