docs: def prune_clusters(clusters, index, n=3):
      """
      Delete clusters with fewer than n elements.
      """
      torem = set(c for c in clusters if c.size < n)
      pruned_clusters = [c for c in clusters if c.size >= n]
      terms_torem = []
      for term, clusters in index.items():
          index[term] = clusters - torem
          if len(index[term]) == 0:
              terms_torem.append(term)
      for t in terms_torem:
          del index[t]
      return pruned_clusters, index