class_docstr: Unit tests for the nearest neighbors builder class.
code: def test_builder_output_types(self):
      builder = self.create_builder(default_class_label="default")
      self.assertIsNotNone(builder)
      self.assertTrue(
          builder.spec.kNearestNeighborsClassifier.HasField(
              "stringClassLabels"
          )
      )
  
      builder = self.create_builder(default_class_label=12)
      self.assertIsNotNone(builder)
      self.assertTrue(
          builder.spec.kNearestNeighborsClassifier.HasField(
              "int64ClassLabels"
          )
      )
  
      with self.assertRaises(TypeError):
          bad_default_label = float(21.32)
          self.create_builder(default_class_label=bad_default_label)
  
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 4 for calling the NearestNeighborsBuilderTest obj's underlying member method code with example usage: obj.test_builder_output_types() without return types