class_docstr: kmeans1d tests
code: def test_cluster(self):
      x = [4.0, 4.1, 4.2, -50, 200.2, 200.4, 200.9, 80, 100, 102]
      k = 4
      clusters, centroids = cluster(x, k)
      self.assertEqual(clusters, [1, 1, 1, 0, 3, 3, 3, 2, 2, 2])
      self.assertEqual(centroids, [-50.0, 4.1, 94.0, 200.5])
  
file_path: coremltools/deps/kmeans1d/tests/test_kmeans1d.py
imports: import unittest
  from kmeans1d import cluster
label_desc: Use image node_id 1 for calling the TestKmeans1D obj's underlying member method code with example usage: obj.test_cluster() without return types