def validate_labels(self, spec, expected):
        """Validate the labels returned from the converted scikit KNeighborsClassifier"""
        self.assertTrue(spec.kNearestNeighborsClassifier.HasField("int64ClassLabels"))
        for index, label in enumerate(
            spec.kNearestNeighborsClassifier.int64ClassLabels.vector
        ):
            self.assertEqual(label, expected[index])
Validate the labels returned from the converted scikit KNeighborsClassifier
coremltools/test/sklearn_tests/test_k_neighbors_classifier.py