code: def __init__(
      self,
      train: np.ndarray,
      connectivity: int = DEFAULT_CONNECTIVITY,
      expansion_add: int = DEFAULT_EXPANSION_ADD,
      expansion_search: int = DEFAULT_EXPANSION_SEARCH,
      *args,
      **kwargs,
  ):
      ndim = train.shape[1]
      super().__init__(
          ndim=ndim,
          connectivity=connectivity,
          expansion_add=expansion_add,
          expansion_search=expansion_search,
          *args,
          **kwargs,
      )
  
      nlist = 10000  # Number of inverted lists (number of partitions).
      nsegment = (
          16  # Number of segments for PQ (number of subquantizers).
      )
      nbit = 8  # Number of bits to encode each segment.
  
      self._original_faiss = self._faiss
      self._faiss = IndexIVFPQ(self._faiss, ndim, nlist, nsegment, nbit)
  
      self._faiss.train(train)
      self._faiss.nprobe = 10
      self._specs["Class"] = "usearch.IndexQuantizedFAISS"
  
file_path: usearch/python/scripts/index_faiss.py
imports: import os
  from typing import Optional
  import numpy
  from faiss import IndexHNSWFlat, IndexIVFPQ, read_index
  from usearch.index import Matches, BatchMatches
  from usearch.index import DEFAULT_CONNECTIVITY, DEFAULT_EXPANSION_ADD, DEFAULT_EXPANSION_SEARCH
label_desc: Use image node_id 1 to create a new IndexQuantizedFAISS object from inherited base classes: IndexFAISS with example: obj = IndexQuantizedFAISS(train, connectivity, expansion_add, expansion_search)