class_docstr: Unit tests for the nearest neighbors builder class.
code: def test_weighting_scheme(self):
      builder = self.create_builder()
      self.assertIsNotNone(builder)
  
      builder.weighting_scheme = "uniform"
      self.assertEqual(builder.weighting_scheme, "uniform")
  
      builder.weighting_scheme = "inverse_distance"
      self.assertEqual(builder.weighting_scheme, "inverse_distance")
  
      builder.weighting_scheme = "unIfOrM"
      self.assertEqual(builder.weighting_scheme, "uniform")
  
      builder.weighting_scheme = "InVerSE_DISTance"
      self.assertEqual(builder.weighting_scheme, "inverse_distance")
  
      with self.assertRaises(TypeError):
          builder.weighting_scheme = "test"
  
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 9 for calling the NearestNeighborsBuilderTest obj's underlying member method code with example usage: obj.test_weighting_scheme() without return types