class_docstr: Unit tests for the nearest neighbors builder class.
code: def test_add_samples_invalid_data(self):
      builder = self.create_builder()
      self.assertIsNotNone(builder)
  
      invalid_X = [[1.0, 2.4]]
      with self.assertRaises(TypeError):
          builder.add_samples(invalid_X, self.training_y)
  
      with self.assertRaises(TypeError):
          builder.add_samples(self.training_X, self.training_y[:3])
  
      with self.assertRaises(TypeError):
          builder.add_samples([], self.training_y)
  
      with self.assertRaises(TypeError):
          builder.add_samples(self.training_X, [])
  
imports: import os
  import shutil
  import unittest
  from coremltools._deps import _HAS_SKLEARN
  from coremltools.models import MLModel
  from coremltools.models.nearest_neighbors import KNearestNeighborsClassifierBuilder
  from coremltools.models.utils import _is_macos
label_desc: Use image node_id 15 for calling the NearestNeighborsBuilderTest obj's underlying member method code with example usage: obj.test_add_samples_invalid_data() without return types