class_docstr: Dense index using Faiss. It is used to index vectors.
  Faiss is a library for efficient similarity search and clustering of dense vectors.
  It contains algorithms that search in sets of vectors of any size, up to ones that possibly do not fit in RAM.
  You can find more information about Faiss here:
  - For index types and the string factory: https://github.com/facebookresearch/faiss/wiki/The-index-factory
  - For GPU settings: https://github.com/facebookresearch/faiss/wiki/Faiss-on-the-GPU
class_docstr_tok: ["Dense","index","using","Faiss",".","It","is","used","to","index","vectors",".","Faiss","is","a","library","for","efficient","similarity","search","and","clustering","of","dense","vectors",".","It","contains","algorithms","that","search","in","sets","of","vectors","of","any","size",",","up","to","ones","that","possibly","do","not","fit","in","RAM",".","You","can","find","more","information","about","Faiss","here",":","-","For","index","types","and","the","string","factory",":","https",":","\/\/github.com\/facebookresearch\/faiss\/wiki\/The-index-factory","-","For","GPU","settings",":","https",":","\/\/github.com\/facebookresearch\/faiss\/wiki\/Faiss-on-the-GPU"]
docstr: Find the nearest examples indices to the query.
  
  Args:
      query (`np.array`): The query as a numpy array.
      k (`int`): The number of examples to retrieve.
  
  Ouput:
      scores (`List[List[float]`): The retrieval scores of the retrieved examples.
      indices (`List[List[int]]`): The indices of the retrieved examples.
docstr_tok: ["Find","the","nearest","examples","indices","to","the","query",".","Args",":","query","(","`","np.array","`",")",":","The","query","as","a","numpy","array",".","k","(","`","int","`",")",":","The","number","of","examples","to","retrieve",".","Ouput",":","scores","(","`","List","[","List","[","float","]","`",")",":","The","retrieval","scores","of","the","retrieved","examples",".","indices","(","`","List","[","List","[","int","]","]","`",")",":","The","indices","of","the","retrieved","examples","."]
code: def search(self, query: np.array, k=10, **kwargs) -> SearchResults:
      """Find the nearest examples indices to the query.
  
      Args:
          query (`np.array`): The query as a numpy array.
          k (`int`): The number of examples to retrieve.
  
      Ouput:
          scores (`List[List[float]`): The retrieval scores of the retrieved examples.
          indices (`List[List[int]]`): The indices of the retrieved examples.
      """
      if len(query.shape) != 1 and (
          len(query.shape) != 2 or query.shape[0] != 1
      ):
          raise ValueError(
              "Shape of query is incorrect, it has to be either a 1D array or 2D (1, N)"
          )
  
      queries = query.reshape(1, -1)
      if not queries.flags.c_contiguous:
          queries = np.asarray(queries, order="C")
      scores, indices = self.faiss_index.search(queries, k, **kwargs)
      return SearchResults(scores[0], indices[0].astype(int))
  
imports: import importlib.util
  import os
  import tempfile
  from pathlib import PurePath
  from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Union
  import fsspec
  import numpy
  from .utils import logging
  from .utils import tqdm
label_desc: Use image node_id 4 for calling the FaissIndex obj's underlying member method code with example usage: obj.search(query, k) and returns: SearchResults