code: def sort_invlists_by_size(index_ivf):
      invlist_sizes = get_invlist_sizes(index_ivf.invlists)
      perm = np.argsort(invlist_sizes)
      permute_invlists(index_ivf, perm)
  
file_path: faiss/contrib/ivf_tools.py
imports: import numpy
  import faiss
  from faiss.contrib.inspect_tools import get_invlist_sizes
label_desc: Use image node_id 6 for calling a global function with example usage: sort_invlists_by_size(index_ivf) without return types