code: def test_run_nn(self):
      examples = [
          {"segment": "a", "_id": "a"},
          {"segment": "b", "_id": "b"},
          {"segment": "c", "_id": "c"},
      ]
  
      model = TestModelNearestNeighbors()
      dataset = lit_dataset.IndexedDataset(
          id_fn=caching.input_hash, examples=examples
      )
      config = {
          "embedding_name": "input_embs",
          "num_neighbors": 2,
      }
      result = self.nearest_neighbors.run(
          dataset.examples[1:2], model, dataset, config=config
      )
      expected = {
          "nearest_neighbors": [
              {"id": "1", "nn_distance": 0.0},
              {"id": "0", "nn_distance": 1.7320508075688772},
          ]
      }
  
      self.assertLen(result, 1)
      testing_utils.assert_deep_almost_equal(self, expected, result[0])
  
file_path: lit/lit_nlp/components/nearest_neighbors_test.py
imports: from absl.testing import absltest
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.components import nearest_neighbors
  from lit_nlp.lib import caching
  from lit_nlp.lib import testing_utils
  import numpy
label_desc: Use image node_id 2 for calling the NearestNeighborTest obj's underlying member method code with example usage: obj.test_run_nn() without return types