code: def compare_overlaps(context: list, synsets_signatures: dict,
                       nbest=False, keepscore=False, normalizescore=False) -> "wn.Synset":
      
  
      overlaplen_synsets = [] # a tuple of (len(overlap), synset).
      for ss in synsets_signatures:
          overlaps = set(synsets_signatures[ss]).intersection(context)
          overlaplen_synsets.append((len(overlaps), ss))
  
      # Rank synsets from highest to lowest overlap.
      ranked_synsets = sorted(overlaplen_synsets, reverse=True)
  
      # Normalize scores such that it's between 0 to 1.
      if normalizescore:
          total = float(sum(i[0] for i in ranked_synsets))
          ranked_synsets = [(i/total,j) for i,j in ranked_synsets]
  
      if not keepscore: # Returns a list of ranked synsets without scores
          ranked_synsets = [i[1] for i in sorted(overlaplen_synsets, reverse=True)]
  
      # Returns a ranked list of synsets otherwise only the best sense.
      return ranked_synsets if nbest else ranked_synsets[0]
docs: Calculates overlaps between the context sentence and the synset_signture
      and returns a ranked list of synsets from highest overlap to lowest.
  
      :param context: List of strings, tokenized sentence or document.
      :param synsets_signatures: dict of Synsets and the set of their corresponding signatures.
      :return: The Synset with the highest number of overlaps with its signatures.