code: def test_accepts_knn_index(self):
      knn_index = nearest_neighbors.Sklearn(self.iris, k=30)
      for method_name, cls in AFFINITY_CLASSES:
          aff = cls(knn_index=knn_index)
          self.assertIs(aff.knn_index, knn_index, msg=method_name)
          self.assertEqual(aff.n_samples, self.iris.shape[0])
  
imports: import logging
  import unittest
  from functools import partial
  import numpy
  from scipy.spatial.distance import squareform, pdist
  from sklearn import datasets
  from sklearn.model_selection import train_test_split
  from openTSNE import affinity, nearest_neighbors
label_desc: Use image node_id 4 for calling the TestAffinityAcceptsKnnIndexAsParameter obj's underlying member method code with example usage: obj.test_accepts_knn_index() without return types