code: def km_num_iterations():
      # Connect to a pre-existing cluster
      # connect to localhost:54321
  
      prostate_h2o = h2o.import_file(
          path=pyunit_utils.locate("smalldata/logreg/prostate.csv")
      )
  
      prostate_km_h2o = H2OKMeansEstimator(k=3, max_iterations=4)
      prostate_km_h2o.train(
          training_frame=prostate_h2o,
          x=list(range(1, prostate_h2o.ncol)),
      )
      num_iterations = prostate_km_h2o.num_iterations()
      assert (
          num_iterations <= 4
      ), "Expected 4 iterations, but got {0}".format(num_iterations)
  
imports: from builtins import range
  import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.kmeans import H2OKMeansEstimator
label_desc: Use image node_id 1 for calling a global function with example usage: km_num_iterations() without return types