code: def _validate_num_clusters(num_clusters, initial_centers, num_rows):
      """
      Validate the combination of the `num_clusters` and `initial_centers`
      parameters in the Kmeans model create function. If the combination is
      valid, determine and return the correct number of clusters.
  
      Parameters
      ----------
      num_clusters : int
          Specified number of clusters.
  
      initial_centers : SFrame
          Specified initial cluster center locations, in SFrame form. If the
          number of rows in this SFrame does not match `num_clusters`, there is a
          problem.
  
      num_rows : int
          Number of rows in the input dataset.
  
      Returns
      -------
      _num_clusters : int
          The correct number of clusters to use going forward
      """
  
      ## Basic validation
      if num_clusters is not None and not isinstance(num_clusters, int):
          raise _ToolkitError(
              "Parameter 'num_clusters' must be an integer."
          )
  
      ## Determine the correct number of clusters.
      if initial_centers is None:
          if num_clusters is None:
              raise ValueError(
                  "Number of clusters cannot be determined from "
                  + "'num_clusters' or 'initial_centers'. You must "
                  + "specify one of these arguments."
              )
          else:
              _num_clusters = num_clusters
  
      else:
          num_centers = initial_centers.num_rows()
  
          if num_clusters is None:
              _num_clusters = num_centers
          else:
              if num_clusters != num_centers:
                  raise ValueError(
                      "The value of 'num_clusters' does not match "
                      + "the number of provided initial centers. "
                      + "Please provide only one of these arguments "
                      + "or ensure the values match."
                  )
              else:
                  _num_clusters = num_clusters
  
      if _num_clusters > num_rows:
          raise ValueError(
              "The desired number of clusters exceeds the number "
              + "of data points. Please set 'num_clusters' to be "
              + "smaller than the number of data points."
          )
  
      return _num_clusters
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import logging
  from array import array
  import turicreate
  from turicreate.toolkits._model import Model
  from turicreate.data_structures.sframe import SFrame
  import turicreate.toolkits._internal_utils
  from turicreate.toolkits._private_utils import _validate_row_label
  from turicreate.toolkits._private_utils import _summarize_accessible_fields
  from turicreate.toolkits._main import ToolkitError
  from turicreate._cython.cy_server import QuietProgress
label_desc: Use image node_id 3 for calling a global function with example usage: _validate_num_clusters(num_clusters, initial_centers, num_rows) and returns: _num_clusters