code: def find_overlap_elements(
      lst: List[Tuple[str, int]],
      string_match_thresh=0.9,
      min_overlap=0.05,
  ) -> List[int]:
      # Initialize a list to store the elements that meet the criteria
      result = []
      titles = [l[0] for l in lst]
  
      for i, (str1, id_num) in enumerate(lst):
          overlap_count = 0  # Count the number of elements that overlap by at least 80%
  
          for j, str2 in enumerate(titles):
              if (
                  i != j
                  and fuzz.ratio(str1, str2)
                  >= string_match_thresh * 100
              ):
                  overlap_count += 1
  
          # Check if the element overlaps with at least 50% of other elements
          if overlap_count >= max(3.0, len(lst) * min_overlap):
              result.append(id_num)
  
      return result
  
file_path: pdf-to-markdown/marker/cleaners/headers.py
imports: import re
  from collections import Counter, defaultdict
  from itertools import chain
  from thefuzz import fuzz
  from sklearn.cluster import DBSCAN
  import numpy
  from marker.schema import Page, FullyMergedBlock
  from typing import List, Tuple
label_desc: Use image node_id 5 for calling a global function with example usage: find_overlap_elements(lst, string_match_thresh, min_overlap) and returns: result