class_docstr: Unit tests for the clustering_centroids module.
class_docstr_tok: ["Unit","tests","for","the","clustering_centroids","module","."]
docstr: Verifies that the centroid initializer factory method returns the expected classes for the given initialization methods.
docstr_tok: ["Verifies","that","the","centroid","initializer","factory","method","returns","the","expected","classes","for","the","given","initialization","methods","."]
code: def testReturnsMethodForExistingInit(self, init_type, method):
      """Verifies that the centroid initializer factory method returns the expected classes for the given initialization methods."""
      self.assertEqual(
          self.factory.get_centroid_initializer(init_type), method
      )
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
  from tensorflow_model_optimization.python.core.clustering.keras import clustering_centroids
label_desc: Use image node_id 4 for calling the ClusteringCentroidsTest obj's underlying member method code with example usage: obj.testReturnsMethodForExistingInit(init_type, method) without return types