parameters: (self, embedding_model, palettes)
docstring: Inits PaletteSearchIndex with a list of color palettes.
  
      The palette index will compute the nearest neighbors in the input palette
      list.
  
      Args:
        embedding_model: PaletteEmbeddingModel. The embedding model to use.
        palettes: A list of strings each representing a 5-color palette.
docstring_summary: Inits PaletteSearchIndex with a list of color palettes.
docstring_tokens: Inits PaletteSearchIndex with a list of color palettes .
function: def __init__(self, embedding_model, palettes):
      """Inits PaletteSearchIndex with a list of color palettes.
  
      The palette index will compute the nearest neighbors in the input palette
      list.
  
      Args:
        embedding_model: PaletteEmbeddingModel. The embedding model to use.
        palettes: A list of strings each representing a 5-color palette.
      """
      self._embedding_model = embedding_model
      embeddings = self._embedding_model.BatchEmbed(palettes)
      self._index = annoy.AnnoyIndex(EMBEDDING_DIMENSION, metric='euclidean')
      for i, embedding in enumerate(embeddings):
        self._index.add_item(i, embedding)
      self._index.build(NUM_ANNOY_TREES)
function_tokens: def __init__ ( self , embedding_model , palettes ) : self . _embedding_model = embedding_model embeddings = self . _embedding_model . BatchEmbed ( palettes ) self . _index = annoy . AnnoyIndex ( EMBEDDING_DIMENSION , metric = 'euclidean' ) for i , embedding in enumerate ( embeddings ) : self . _index . add_item ( i , embedding ) self . _index . build ( NUM_ANNOY_TREES )