class_docstr: Unit tests for the nearest neighbors builder class.
code: def test_leaf_size(self):
      builder = self.create_builder()
      self.assertIsNotNone(builder)
  
      builder.set_index_type(
          "kd_tree", leaf_size=45
      )  # test user-defined value
      self.assertEqual(builder.index_type, "kd_tree")
      self.assertEqual(builder.leaf_size, 45)
  
      builder.leaf_size = 12
      self.assertEqual(builder.index_type, "kd_tree")
      self.assertEqual(builder.leaf_size, 12)
  
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 11 for calling the NearestNeighborsBuilderTest obj's underlying member method code with example usage: obj.test_leaf_size() without return types