class_docstr: Computes nearest neighbors of an example embedding.
  
  Required Model Output:
    - Embeddings (`emb_layer`) to return the input embeddings
        for a layer
code: def is_compatible(
      self, model: lit_model.Model, dataset: lit_dataset.Dataset
  ) -> bool:
      dataset_embs = utils.spec_contains(
          dataset.spec(), types.Embeddings
      )
      model_out_embs = utils.spec_contains(
          model.output_spec(), types.Embeddings
      )
      return dataset_embs or model_out_embs
  
file_path: lit/lit_nlp/components/nearest_neighbors.py
imports: from collections.abc import Sequence
  import dataclasses
  from typing import Optional
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.lib import utils
  import numpy
  from scipy.spatial import distance
label_desc: Use image node_id 1 for calling the NearestNeighbors obj's underlying member method code with example usage: obj.is_compatible(model, dataset) and returns: unknown